CodeSmith the base class template (Help content in CodeSmith)

Basic template class
Type Description: 
Batch      
OutputFileCodeTemplate these templates can be saved to a file during the build process through inheritance their output 
ScriptError appear in a script execution error
ScriptErrorCollection   
ScriptResult run a script results contain some errors have occurred
ScriptUtility this class Sql script can be used to execute on the database.
SqlCodeTemplate inherited template class when generating code from a data source can be obtained Sql many useful methods to help
string type, various processing methods StringUtility

Member properties and methods under various types


Batch Class
Properties
Content   
LineCount   
StartLineNumber 
method
Finalize get free resources before an object is created again and perform other operations to clear
a copy of an existing object MemberwiseClone established

OutputFileCodeTemplate Class
attribute
CodeTemplateInfo get the current template information
OutputFile This attribute is used to specify the output file name of a saved template output
Progress report template provides a way of implementation process
Response template output return flow. This property can be written in the program flow
state State stencil instance
ValidationErrors get the wrong template
method
CopyPropertiesTo copy attributes to match the code template to another example
GetCodeTemplateInstance overloaded, resulting template instance specified
GetFileName obtained as an output a default template name
GetProperties get all the properties of the template
GetProperty get the template specified property
GetRequiredProperties get on the template with all necessary attributes
GetType get the current instance of the type of
default ParseDefaultValue resolve property values
SavePropertiesToXml to save XML attribute
SavePropertiesToXmlFile save attributes to an XML document
SetProperty overload, save specified property value
ToString

ScriptError Class
Properties

The method
Finalize get free resources before an object is created again and perform other operations to clear
a copy of an existing object MemberwiseClone established

ScriptUtility Class
attributes
this script when executing the connection string ConnectionString
Script execution script
method
ExecuteScript overloading, execute scripts

SqlCodeTemplate Class
attribute
CodeTemplateInfo get the current template information
OutputFile This attribute is used to specify the output file name of a saved template output
Progress report template provides a way of implementation process
Response template output return flow. This property can be written in a program stream
template instance State state
error obtained stencil ValidationErrors
method
CopyPropertiesTo copy attributes to match the code template to another example
GetCamelCaseName Returns A GIVEN CAMEL cased name from The identifier. 
GetCodeTemplateInstance overloaded, resulting designated template examples
GetCSharpVariableType based on a given column returns C # variable types
get a default name for the template output GetFileName
GetMemberVariableDeclarationStatement overloaded, return C # member variable declaration statement
GetMemberVariableDefaultValue return a default value based on the data type of a column of
GetMemberVariableName for a given label C # returns a member variable name
GetProperties get all the properties of the template
GetProperty obtained template specified attribute
GetPropertyName Returns the specified column public attribute name
GetReaderMethod Returns The name of The typed Reader Method for A GIVEN column. 
GetRequiredProperties obtained stencil all necessary attributes
GetSpacedName Returns A Spaced in OUT Version of The identifier.
GetSqlDbType returns a SqlDbType a given column
GetSqlParameterExtraParams parameter declaration ADO generated additional parameters
GetSqlParameterStatement overloaded, returns to the parameter declaration T-Sql given column of
GetSqlParameterStatements
   overloads applied to a specified column ADO object parameter to generate a specified statement (generates an statement that ADDS a Parameter Assignment to a gIVEN the column for the ADO Object.)
GetValidateStatements generating a set of a column-based acknowledgment
IncludeEmptyCheck determine whether a given column may be empty
definition identifies the type of a given column IncludeMaxLengthCheck whether the maximum length
IsUserDefinedType determine whether a given column with a UDT (user defined type)
default ParseDefaultValue resolve property values
SavePropertiesToXml to save XML attribute
SavePropertiesToXmlFile save attributes to an XML document
SetProperty Overload, save the specified property values

 

Reproduced in: https: //my.oschina.net/garyun/blog/602754

Guess you like

Origin blog.csdn.net/weixin_34405925/article/details/91774361