Codesmith Basic template class (content in Codesmith help)

Source: Internet
Author: User

Basic template class
Type description:
Batch
Outputfilecodetemplate templates can save their output to a file during the build process by inheriting this class
Scripterror An error occurred in the execution of the script
Scripterrorcollection
Scriptresult The result of running a script contains some errors that have occurred
Scriptutility This class can be used to execute SQL scripts on the database.
Sqlcodetemplate inherits the template of this class when generating code from a SQL data source, there are many useful ways to help
Stringutility multiple methods for handling string types

member properties and methods under various types


Batch Class
Property
Content
LineCount
Startlinenumber
Method
Finalize to get idle resources and perform other vacuuming operations before an object is created again
MemberwiseClone creating a copy of an existing object

Outputfilecodetemplate Class
Property
Codetemplateinfo getting information about the current template
OutputFile This property is used to specify the output file name of a saved template output
Progress provides a way to report a template's execution process
The Response template output returns a stream. This property can write out the stream in the program
Status of the state template instance
Validationerrors getting a template error
Method
Copypropertiesto copy the matching attributes to another code template instance
Getcodetemplateinstance overloads to get an instance of the specified template
GetFileName to get a default name for the output of the template
GetProperties get all the properties of the template
GetProperty to get the specified properties of the template
Getrequiredproperties get all the necessary properties on the stencil
GetType getting the current instance type
Parsedefaultvalue default values for parsing properties
Savepropertiestoxml Saving attributes in XML
Savepropertiestoxmlfile saving attributes to an XML document
SetProperty overload, saving the specified property value
Tostring

Scripterror Class
Property

Method
Finalize to get idle resources and perform other vacuuming operations before an object is created again
MemberwiseClone creating a copy of an existing object

Scriptutility Class
Property
ConnectionString Use this connection string when executing scripts
Scripts executed by script
Method
Executescript overloading, executing scripts

sqlcodetemplate Class
Property
Codetemplateinfo getting information about the current template
OutputFile This property is used to specify the output file name of a saved template output
Progress provides a way to report a template's execution process
The Response template output returns a stream. This property can write out the stream in the program
Status of the state template instance
Validationerrors getting a template error
Method
Copypropertiesto copy the matching attributes to another code template instance
Getcamelcasename Returns A camel cased name from the given identifier.
Getcodetemplateinstance overloads to get an instance of the specified template
Getcsharpvariabletype returns the variable type of C # based on a given column
GetFileName to get a default name for the output of the template
Getmembervariabledeclarationstatement overloads, returning C # member variable declaration statements
Getmembervariabledefaultvalue returns a default value based on the data type of a column
Getmembervariablename returns a C # member variable name for a given label
GetProperties get all the properties of the template
GetProperty to get the specified properties of the template
Getpropertyname returns the name of the public property of the specified column
Getreadermethod Returns The name of the typed reader method for a given column.
Getrequiredproperties get all the necessary properties on the stencil
Getspacedname Returns a spaced out version of the identifier.
Getsqldbtype returns the SqlDbType of a given column
Getsqlparameterextraparams generating additional parameters for ADO parameter declarations
Getsqlparameterstatement overload, returns the parameter declaration of T-SQL for a given column
Getsqlparameterstatements
overloading, adding a parameter to the specified column to the ADO object generates a specified declaration (generates an assignment statement, adds a parameter to a ADO object for the given column. )
Getvalidatestatements generating a set of acknowledgment statements based on a column
Includeemptycheck determines whether a given column can be empty
Includemaxlengthcheck determines whether the type of a given column requires a definition of the maximum length
Isuserdefinedtype determines if a UDT is used for a given column (user-defined type)
Parsedefaultvalue default values for parsing properties
Savepropertiestoxml Saving attributes in XML
Savepropertiestoxmlfile saving attributes to an XML document
SetProperty overload, saving the specified property value

Codesmith Basic template class (content in Codesmith help)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.