You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this will get compilation error because SqlScriptGeneratorVisitor and ScriptWriter are marked as internal, which is impossible to inherit this class.
Describe the solution you'd like
Change CreateSqlScriptGeneratorVisitor(...) become protected instead of internal
Remove ScriptWriter parameter in CreateSqlScriptGeneratorVisitor(...). This can avoid to mark ScriptWriter as public. Instantiation of ScriptWriter will be handled by child class of SqlScriptGenerator. See example below.
Mark SqlScriptGeneratorVisitor as public accessible. SqlScriptGeneratorVisitor will be used to visit the expression tree when generating TSQL script.
publicsealedclassSql100ScriptGenerator:SqlScriptGenerator{publicSql100ScriptGenerator():this(newSqlScriptGeneratorOptions()){}publicSql100ScriptGenerator(SqlScriptGeneratorOptionsoptions):base(options){}protectedoverrideSqlScriptGeneratorVisitorCreateSqlScriptGeneratorVisitor(SqlScriptGeneratorOptionsoptions){// Create instance of ScriptWriter. //Currently this is created by private function in SqlScriptGeneratorScriptWriterscriptWriter=newScriptWriter(options);ScriptGeneratorSupporter.CheckForNullReference((object)options,nameof(options));ScriptGeneratorSupporter.CheckForNullReference((object)scriptWriter,nameof(scriptWriter));return(SqlScriptGeneratorVisitor)newSql100ScriptGeneratorVisitor(options,scriptWriter);}}
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Consider the following code to inherit
SqlScriptGenerator
However, this will get compilation error because
SqlScriptGeneratorVisitor
andScriptWriter
are marked asinternal
, which is impossible to inherit this class.Describe the solution you'd like
CreateSqlScriptGeneratorVisitor(...)
becomeprotected
instead ofinternal
ScriptWriter
parameter inCreateSqlScriptGeneratorVisitor(...)
. This can avoid to markScriptWriter
aspublic
. Instantiation ofScriptWriter
will be handled by child class ofSqlScriptGenerator
. See example below.SqlScriptGeneratorVisitor
as public accessible.SqlScriptGeneratorVisitor
will be used to visit the expression tree when generating TSQL script.Here is the suggested changes:
And update
Sql###ScriptGenerator
becomeExample:
The text was updated successfully, but these errors were encountered: