mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-05 00:37:21 +08:00
模型类
This commit is contained in:
29
Yi.Framework/Yi.Framework.Service/RoleService.cs
Normal file
29
Yi.Framework/Yi.Framework.Service/RoleService.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user