zoukankan      html  css  js  c++  java
  • T4 simple template

    下载

    http://t4-editor.tangible-engineering.com/Download_T4Editor_Plus_ModelingTools.html

    添加新建项Simple T4 Template,生成IBLL,注意不是添加运行时文本模板

    <#@ template language="C#" debug="false" hostspecific="true"#>
    <#@ include file="EF.Utility.CS.ttinclude"#>
    <#@ output extension=".cs"#> 
     <#
    CodeGenerationTools code = new CodeGenerationTools(this);
    MetadataLoader loader = new MetadataLoader(this);
    CodeRegion region = new CodeRegion(this, 1);
    MetadataTools ef = new MetadataTools(this);
    
    string inputFile = @"..ModelModel.edmx";
    
    EdmItemCollection ItemCollection = loader.CreateEdmItemCollection(inputFile);
    string namespaceName = code.VsNamespaceSuggestion();
    
    EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this);
    
    #>
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    
    namespace IBLL
    {
    <#
    
    // Emit Entity Types
    foreach (EntityType entity in ItemCollection.GetItems<EntityType>().OrderBy(e => e.Name))
    {
        //fileManager.StartNewFile(entity.Name + "RepositoryExt.cs");
        //BeginNamespace(namespaceName, code);
        
    #>
        public partial interface I<#=entity.Name#>BLL : IBaseBLL<Model.<#=entity.Name#>>
        {
        
        }
    
    <#}#>
    
    }
  • 相关阅读:
    java字符串实现正序和倒序输出
    暑假前挑战赛1—— A,B题解
    深搜
    poj 1200 Crazy Search
    poj 1840 Eqs (hash)
    Choose the best route
    一个人的旅行
    畅通工程续
    最短路基础算法
    完全背包问题
  • 原文地址:https://www.cnblogs.com/tgdjw/p/4673204.html
Copyright © 2011-2022 走看看