mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-20 08:26:37 +08:00
优化代码
This commit is contained in:
@@ -39,6 +39,19 @@ namespace Yi.Framework.Service
|
||||
public partial class <#= fn #>Service:BaseService<<#= k #>>,I<#= fn #>Service
|
||||
{
|
||||
public <#= fn #>Service(DbContext Db):base(Db){ }
|
||||
|
||||
public async Task<bool> DelListByUpdateAsync(List<int> _ids)
|
||||
{
|
||||
var <#= k #>List = await GetEntitiesAsync(u=>_ids.Contains(u.id));
|
||||
<#= k #>List.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted);
|
||||
return await UpdateListAsync(<#= k #>List);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<<#= k #>>> GetAllEntitiesTrueAsync()
|
||||
{
|
||||
return await GetEntitiesAsync(u=> u.is_delete == (short)Common.Enum.DelFlagEnum.Normal);
|
||||
}
|
||||
|
||||
}
|
||||
<# } #>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user