Merge branch 'feature/7759269' of http://46.146.209.148:8080/DDrilling/AsbCloudServer into feature/7759269

This commit is contained in:
ai.astrakhantsev 2022-11-29 11:23:14 +05:00
commit fd69b4c80a

View File

@ -193,8 +193,8 @@ namespace AsbCloudInfrastructure.Repository
var idsIncludeRole = GetNestedByIds(dto.Roles.Select(x => x.Id)).Select(x => x.Id);
if (idsIncludeRole is null || idsIncludeRole.Any(x => x == dto.Id))
throw new ArgumentInvalidException("Invalid include role", nameof(UserRoleDto));
if (idsIncludeRole is not null && idsIncludeRole.Any(x => x == dto.Id))
throw new ArgumentInvalidException("Invalid include role (self reference)", nameof(dto));
var relations = await dbContext.RelationUserRoleUserRoles
.Where(r => r.Id == dto.Id)
@ -252,19 +252,9 @@ namespace AsbCloudInfrastructure.Repository
private void DropCacheUserRole()
=> dbContext.RelationUserUserRoles.DropCache(userRoleCacheTag);
private Task<IEnumerable<RelationUserRoleUserRole>> GetCacheRelationUserRoleUserRoleAsync(CancellationToken token)
=> dbContext.RelationUserRoleUserRoles
.Include(r => r.IncludeRole)
.Include(r => r.Role)
.FromCacheAsync(relationUserRoleUserRoleCacheTag, relationCacheObsolence, token);
private void DropCacheRelationUserRoleUserRole()
=> dbContext.RelationUserUserRoles.DropCache(relationUserRoleUserRoleCacheTag);
private Task<IEnumerable<RelationUserRolePermission>> GetCacheRelationUserRolePermissionsAsync(CancellationToken token)
=> dbContext.RelationUserRolePermissions
.Include(r => r.UserRole)
.Include(r => r.Permission)
.FromCacheAsync(relationUserRolePermissionsCacheTag, relationCacheObsolence, token);
private IEnumerable<RelationUserRolePermission> GetCacheRelationUserRolePermissions()
=> dbContext.RelationUserRolePermissions
.Include(r => r.UserRole)