Files
Yi.Admin/CC.Yi/CC.Yi.BLL/T4BLL.tt

50 lines
1.5 KiB
Plaintext
Raw Normal View History

2021-03-20 14:12:24 +08:00
<#@ 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.IBLL;
using CC.Yi.IDAL;
using CC.Yi.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
2021-05-13 01:39:34 +08:00
using Microsoft.EntityFrameworkCore;
2021-03-20 14:12:24 +08:00
namespace CC.Yi.BLL
{
<# foreach(string k in ModelData){
#>
public partial class <#=k #>Bll : BaseBll<<#=k #>>, I<#=k #>Bll
{
2021-05-13 01:39:34 +08:00
public <#=k #>Bll(IBaseDal<<#=k #>> cd,DataContext _Db):base(cd,_Db)
2021-03-20 14:12:24 +08:00
{
CurrentDal = cd;
2021-06-02 20:00:25 +08:00
Db = _Db;
2021-03-20 14:12:24 +08:00
}
2021-06-02 20:00:25 +08:00
public async Task<bool> DelListByUpdateList(List<int> Ids)
{
var entitys = await CurrentDal.GetEntities(u => Ids.Contains(u.id)).ToListAsync();
foreach (var entity in entitys)
{
entity.is_delete = (short)ViewModel.Enum.DelFlagEnum.Deleted;
}
return Db.SaveChanges() > 0;
}
2021-03-20 14:12:24 +08:00
}
<# } #>
}