Mobile Big Data _sql Mapping Object _ Dynamic Soft _ code template _models

Source: Internet
Author: User

<#@ Template language="C #"Hostspecific="True"#><#@ Output extension=". CS"#><# Tablehost Host=(Tablehost) (Host); Host. Fieldlist.sort (Codecommon.comparebyintorder);>usingSystem;usingSystem.Text;usingSystem.Collections.Generic;usingSystem.Data;usingMyAttribute;usingSystem.Runtime.Serialization;namespacemodels<#if(host. Folder.length >0) {#>.<#= host. Folder #><#} #> {<#if(host. Tabledescription.length >0) {#>//<#= host. Tabledescription #><#} #>[MyTable ("<#= host. Getmodelclass (host. TableName) #>")] [DataContract]//entity class contract[Knowntype (typeof(<#= host.) Getmodelclass (host. TableName) #>))]     Public class<#= host. Getmodelclass (host. TableName) #>: basemodels {<#foreach(Columninfo CinchHost. FieldList) {#>Private<#if("string"= = Codecommon.dbtypetocs (c.typename). ToString (). ToLower ()) {#> <#=codecommon.dbtypetocs (c.typename) #> <#}Else{#> <#=codecommon.dbtypetocs (c.typename) #>?<#} #> _<#= c.columnname.tostring (). ToLower () #>; /// <summary>        /// <#= String. IsNullOrEmpty (c.description)? C.columnname:c.description #>        /// </summary>[DataMember] [Mycolumns ("<#= c.columnname #>", Dbtype.<#=codecommon.dbtypetocs (C.typename). ToString (). Substring (0,1). ToUpper () #><#=codecommon.dbtypetocs (c.typename). ToString (). Substring (1) #>)]         Public<#if("string"= = Codecommon.dbtypetocs (c.typename). ToString (). ToLower ()) {#> <#=codecommon.dbtypetocs (c.typename) #> <#}Else{#> <#=codecommon.dbtypetocs (c.typename) #>?<#} #> <#= c.columnname #>        {            Get{return_<#= c.columnname.tostring (). ToLower () #>; } Set{_<#= c.columnname.tostring (). ToLower () #> =value;} }<#} #>    }}

Simple 30% Template (right-click)----NEW----template

Right-click Edit View, Paste code, right-click Save

Find a table, template code generation

Double-click your template to generate the code, OK.

Generate code

Mobile Big Data _sql Mapping Object _ Dynamic Soft _ code template _models

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.