zoukankan      html  css  js  c++  java
  • CodeSmith访问数据库

    <%@ CodeTemplate Language="C#" TargetLanguage="C#" ResponseEncoding="UTF-8" Debug="False" Description="Creates a simplistic entity object." %> 
    
    <%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Category="Context" Description="Table that the stored procedures should be based on." %> 
    <%@ Assembly Name="SchemaExplorer" %> 
    <%@ Import Namespace="SchemaExplorer" %> 
    
    using System; 
    using System.Runtime.Serialization; 
    
    namespace BE 
    { 
        /// <summary> 
        /// <%= SourceTable.Name %> 实体类 
        /// TerryFeng <%= DateTime.Now.ToString()%> 
        /// </summary> 
        [DataContract] 
        public class <%= SourceTable.Name %> 
        { 
            #region 私有成员 
            <% for (int i = 0; i < SourceTable.Columns.Count; i++) { %> 
            private <%= SourceTable.Columns[i].SystemType %> _<%= StringUtil.ToCamelCase(SourceTable.Columns[i].Name) %>; 
            <% } %> 
            #endregion 
            #region 数据契约属性 
            <% for (int i = 0; i < SourceTable.Columns.Count; i++) { %> 
            /// <summary> 
            /// <%= SourceTable.Columns[i].Description %> 
            /// </summary> 
            [DataMember] 
            public <%= SourceTable.Columns[i].SystemType %> <%= StringUtil.ToPascalCase(SourceTable.Columns[i].Name) %> 
            { 
                get 
                { 
                    return this._<%= StringUtil.ToCamelCase(SourceTable.Columns[i].Name) %>; 
                } 
                set 
                { 
                    this._<%= StringUtil.ToCamelCase(SourceTable.Columns[i].Name) %> = value; 
                } 
            } 
            <% } %> 
            #endregion 
        } 
    } 
    
  • 相关阅读:
    Windows下React Native环境配置
    数据处理函数$.grep,$.map,$.makeArray,sort
    gulp的安装与使用
    模块化管理ajax
    Windows操作系统下ionic开发环境搭建
    css平行四边形与菱形变换
    JavaScript数组排序总结
    JavaScript数组去重总结
    vue之修饰符
    深拷贝、浅拷贝
  • 原文地址:https://www.cnblogs.com/lilun/p/1753247.html
Copyright © 2011-2022 走看看