mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 02:29:24 +08:00
同步openauth.Core:
采用代码生成器的表结构控制前端显示,删除以前按照dbset获取数据库结构 优化注释 升级EF及所有三方的版本
This commit is contained in:
@@ -7,6 +7,7 @@ using OpenAuth.Repository.Interface;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.Repository;
|
||||
|
||||
@@ -44,10 +45,10 @@ namespace OpenAuth.App
|
||||
objs = objs.Where(u => u.Name.Contains(request.key));
|
||||
}
|
||||
|
||||
result.data = objs.OrderBy(u => u.Name)
|
||||
result.data = await objs.OrderBy(u => u.Name)
|
||||
.Skip((request.page - 1) * request.limit)
|
||||
.Take(request.limit).ToList();
|
||||
result.count = objs.Count();
|
||||
.Take(request.limit).ToListAsync();
|
||||
result.count = await objs.CountAsync();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -79,6 +80,21 @@ namespace OpenAuth.App
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除角色时,需要删除角色对应的权限
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
public override void Delete(string[] ids)
|
||||
{
|
||||
UnitWork.ExecuteWithTransaction(() =>
|
||||
{
|
||||
UnitWork.Delete<Relevance>(u=>(u.Key == Define.ROLEMODULE || u.Key == Define.ROLEELEMENT) && ids.Contains(u.FirstId));
|
||||
UnitWork.Delete<Relevance>(u=>u.Key == Define.USERROLE && ids.Contains(u.SecondId));
|
||||
UnitWork.Delete<Role>(u =>ids.Contains(u.Id));
|
||||
UnitWork.Save();
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新角色属性
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user