<%@ CodeTemplate Language="C#" TargetLanguage="C#" ResponseEncoding="UTF-8" Debug="False" Description="生成資料庫實體" %> <%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Category="屬性" Description="要生成實體的資料表" %> <%@ Property Name="NameSpace" Type="System.String" Optional="False" Default="Modul" Category="屬性" Description="實體類所在的名稱空間" %> <%@ Property Name="opuser" Type="System.String" Default="wlitsoft" Optional="False" Category="屬性" Description="請輸入您的名字" %> <%@ Map Name="CSharpAlias" Src="System-CSharpAlias" Description="System to C# Type Map" %> <%@ Assembly Name="SchemaExplorer" %> <%@ Import Namespace="SchemaExplorer" %> /* *本程式碼由程式碼生成器自動生成,請不要更改此檔案的任何程式碼。 *生成時間:<%= DateTime.Now.ToLocalTime() %> *生成者:<%= opuser %> */ using System; namespace <%= this.NameSpace %> { ///<summary> ///表<%= this.SourceTable.Name %>的實體類 ///</summary> public class <%= this.SourceTable.Name %> { <%--生成私有欄位.net2.0--%> <% foreach (ColumnSchema column in this.SourceTable.Columns) { %> private <%= CSharpAlias[column.SystemType.FullName] %> <%= StringUtil.ToCamelCase(column.Name) %>; <% } %> <% foreach(ColumnSchema column in this.SourceTable.Columns){%> <%--生成get set 方法--%> /// <summary> /// <%= column.Description %> /// </summary> public <%= CSharpAlias[column.SystemType.FullName] %> <%= StringUtil.ToPascalCase(column.Name) %> { get { return <%= StringUtil.ToCamelCase(column.Name) %>; } set { <%= StringUtil.ToCamelCase(column.Name) %> = value; } } <%}%> } }