Files
Yi.Framework/CC.Yi.Model/T4DataContext.tt
454313500@qq.com c62389a7c0 v1.0.7
2021-03-25 20:44:12 +08:00

31 lines
981 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 Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
namespace CC.Yi.Model
{
public partial class DataContext :IdentityDbContext
{
<# foreach(string k in ModelData){
#>
public DbSet<<#=k #>> <#=k #> { get; set; }
<# } #>
}
}