CodeSmith生成三层代码之抽象工厂(5)

<%@ CodeTemplate Language="C#" ResponseEncoding="UTF-8" TargetLanguage="Text" Src="" Debug="False" Description="Template description here." %>
<%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Category="Context" Description="请选择数据表!" %>
<%@ Property Name="NameSpace" Type="System.String" Default="" Optional="False" Category="Description" Description="请输入命名空间" %>
<%@ Property Name="Author" Type="System.String" Default="Pantao" Optional="False" Category="Description" Description="About Author" %>
<%@ Assembly Name="SchemaExplorer" %>
<%@ Import Namespace="SchemaExplorer" %>
/// <summary>
/// 创建<%=SourceTable.Name%>数据层接口
/// </summary>
public static <%=NameSpace%>.IDAL.I<%=SourceTable.Name%> Create<%=SourceTable.Name%>()
{
string ClassNamespace = AssemblyPath + ".<%=SourceTable.Name%>";
object objType = CreateObject(AssemblyPath, ClassNamespace);
return (<%=NameSpace%>.IDAL.I<%=SourceTable.Name%>)objType;

你可能感兴趣的:(C++,c,C#)