有用到EntityFrameWork的同学们,可以用用。
<#@ template language="c#" HostSpecific="True" #>
<#@ output
extension= ".cs" #>
<#
TableHost host =
(TableHost)(Host);
host.Fieldlist.Sort(CodeCommon.CompareByintOrder);
#>
using
System;
using System.Text;
using System.Collections.Generic;
using
System.Data;
namespace <#= host.NameSpace #>.Model<# if(
host.Folder.Length > 0) {#>.<#= host.Folder #><# }
#>
{
<# if( host.TableDescription.Length > 0)
{#>
/// <summary>
///<#= host.TableDescription #>
///
</summary>
[Table("<#=
host.GetModelClass(host.TableName) #>")]
<# }
#>
public class <#= host.GetModelClass(host.TableName)
#>
{
<# foreach (ColumnInfo c in
host.Fieldlist)
{ #>/// <summary>
///
<#= string.IsNullOrEmpty(c.Description) ? c.ColumnName : c.Description
#>
///
</summary>
[Column("<#=
c.ColumnName #>")]
public
<#= CodeCommon.DbTypeToCS(c.TypeName) #> <#= c.ColumnName #>{
get;set; }
<# }
#>
}
}
动软代码生成与 EntityFramework 实体生成模板,布布扣,bubuko.com
动软代码生成与 EntityFramework 实体生成模板
原文:http://www.cnblogs.com/axinno1/p/3599359.html