Files
Yi.Framework/CC.Yi.DAL/T4DAL.tt
454313500@qq.com fe850bbc2c v2.0.0
2021-05-13 01:39:34 +08:00

35 lines
1014 B
Plaintext

<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.IO" #>
<#@ output extension=".cs" #>
<#
string solutionsPath = Host.ResolveAssemblyReference("$(SolutionDir)");//获取解决方案路径
string txt;
StreamReader sr = new StreamReader(solutionsPath+@"\T4Model\T4Model.txt");
txt=sr.ReadToEnd();
sr.Close();
string[] ModelData= txt.Split(',');
#>
using CC.Yi.IDAL;
using CC.Yi.Model;
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.EntityFrameworkCore;
namespace CC.Yi.DAL
{
<# foreach(string k in ModelData){
#>
public partial class <#=k #>Dal : BaseDal<<#=k #>>, I<#=k #>Dal
{
public <#=k #>Dal(DataContext _Db):base(_Db)
{
Db = _Db;
}
}
<# } #>
}