mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-03 00:00:58 +08:00
30 lines
924 B
C#
30 lines
924 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Yi.Framework.Interface;
|
|
using Yi.Framework.Model.Models;
|
|
|
|
namespace Yi.Framework.Service
|
|
{
|
|
public class RoleService:BaseService<role>, IRoleService
|
|
{
|
|
public RoleService(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<role>> GetAllEntitiesTrueAsync()
|
|
{
|
|
return await _Db.Set<role>().Where(u => u.is_delete == (short)Common.Enum.DelFlagEnum.Normal).ToListAsync();
|
|
}
|
|
}
|
|
}
|