使用sqlsugar内置工作单元
This commit is contained in:
@@ -8,7 +8,6 @@ using Yi.Framework.Interface;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
using Yi.Framework.Repository;
|
||||
using Yi.Framework.Service.Base;
|
||||
using Yi.Framework.Uow.Interceptors;
|
||||
using Yi.Framework.Interface.RABC;
|
||||
using Yi.Framework.DTOModel.Base.Dto;
|
||||
|
||||
@@ -21,17 +20,11 @@ namespace Yi.Framework.Service.RABC
|
||||
}
|
||||
public async Task<List<RoleEntity>> DbTest()
|
||||
{
|
||||
return await _repository._Db.Queryable<RoleEntity>().ToListAsync();
|
||||
}
|
||||
//添加工作单元特性
|
||||
[UnitOfWork]
|
||||
public async Task<bool> UowTest()
|
||||
{
|
||||
var res = await _repository.InsertReturnSnowflakeIdAsync(new RoleEntity { RoleName = "测试", RoleCode = "tt" });
|
||||
throw new ApplicationException("测试uow");
|
||||
return res > 0;
|
||||
return await _repository._DbQueryable.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<bool> GiveRoleSetMenu(List<long> roleIds, List<long> menuIds)
|
||||
{
|
||||
var _repositoryRoleMenu = _repository.ChangeRepository<Repository<RoleMenuEntity>>();
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Yi.Framework.Interface\Yi.Framework.Interface.csproj" />
|
||||
<ProjectReference Include="..\Yi.Framework.Uow\Yi.Framework.Uow.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user