@@ -15,31 +15,16 @@ namespace Yi.Framework.Service
|
||||
public UserService(DbContext Db):base(Db)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<bool> DelListByUpdateAsync(List<int> _ids)
|
||||
{
|
||||
var userList = await GetEntitiesAsync(u => _ids.Contains(u.id));
|
||||
userList.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Deleted);
|
||||
return await UpdateListAsync(userList);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<user>> GetAllEntitiesTrueAsync()
|
||||
{
|
||||
return await GetEntitiesAsync(u=>u.is_delete==(short)Common.Enum.DelFlagEnum.Normal);
|
||||
return await _Db.Set<user>().Where(u=>u.is_delete==(short)Common.Enum.DelFlagEnum.Normal).ToListAsync();
|
||||
}
|
||||
public async Task<bool> AddEntitesAsync(List<user> _users)
|
||||
{
|
||||
_users.ToList().ForEach(u => u.is_delete = (short)Common.Enum.DelFlagEnum.Normal);
|
||||
return await AddEntitesAsync(_users);
|
||||
}
|
||||
public async Task<IEnumerable<user>> GetEntitiesTrueByIdAsync(List<int> _ids)
|
||||
{
|
||||
return await GetEntitiesAsync(u => _ids.Contains(u.id));
|
||||
}
|
||||
public async Task<bool> UpdateEntitesAsync(List<user> _users)
|
||||
{
|
||||
return await UpdateEntitesAsync(_users);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user