CS2-123: Fixed UserRoleController to user UserRoleService, not CRUD service

This commit is contained in:
KharchenkoVladimir 2021-11-25 12:24:53 +05:00
parent 576d119674
commit 2f23fbce70
2 changed files with 7 additions and 4 deletions

View File

@ -55,7 +55,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ICrudService<WellDto>, CrudServiceBase<WellDto, Well>>();
services.AddTransient<ICrudService<CompanyDto>, CrudServiceBase<CompanyDto, Company>>();
services.AddTransient<ICrudService<UserDto>, CrudServiceBase<UserDto, User>>();
services.AddTransient<ICrudService<UserRoleDto>, CrudServiceBase<UserRoleDto, UserRole>>();
services.AddTransient<ICrudService<UserRoleDto>, UserRoleService>();
services.AddTransient<ICrudService<TelemetryDto>, CrudServiceBase<TelemetryDto, Telemetry>>();
services.AddTransient<ICrudService<DrillParamsDto>, DrillParamsService>();

View File

@ -23,11 +23,14 @@ namespace AsbCloudInfrastructure.Services
cacheDb.GetCachedTable<RelationUserRolePermission>((AsbCloudDbContext)context);
}
public override async Task<IEnumerable<UserRoleDto>> GetAllAsync(CancellationToken token = default)
public override async Task<PaginationContainer<UserRoleDto>> GetPageAsync(int skip = 0,
int take = 32, CancellationToken token = default)
{
var rolesDtos = await base.GetAllAsync(token);
var rolesDtos = await base.GetPageAsync(skip, take,token);
return rolesDtos.Select(FillUserRoleWithPermissions);
rolesDtos.Items = rolesDtos.Items.Select(FillUserRoleWithPermissions).ToList();
return rolesDtos;
}
public override async Task<UserRoleDto> GetAsync(int id, CancellationToken token = default)