From 2f23fbce702f56a93bbf00976e484bb6b659cb81 Mon Sep 17 00:00:00 2001 From: KharchenkoVladimir Date: Thu, 25 Nov 2021 12:24:53 +0500 Subject: [PATCH] CS2-123: Fixed UserRoleController to user UserRoleService, not CRUD service --- AsbCloudInfrastructure/DependencyInjection.cs | 2 +- AsbCloudInfrastructure/Services/UserRoleService.cs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/AsbCloudInfrastructure/DependencyInjection.cs b/AsbCloudInfrastructure/DependencyInjection.cs index 580bb356..d7d06ba9 100644 --- a/AsbCloudInfrastructure/DependencyInjection.cs +++ b/AsbCloudInfrastructure/DependencyInjection.cs @@ -55,7 +55,7 @@ namespace AsbCloudInfrastructure services.AddTransient, CrudServiceBase>(); services.AddTransient, CrudServiceBase>(); services.AddTransient, CrudServiceBase>(); - services.AddTransient, CrudServiceBase>(); + services.AddTransient, UserRoleService>(); services.AddTransient, CrudServiceBase>(); services.AddTransient, DrillParamsService>(); diff --git a/AsbCloudInfrastructure/Services/UserRoleService.cs b/AsbCloudInfrastructure/Services/UserRoleService.cs index dbc7050e..dc9226be 100644 --- a/AsbCloudInfrastructure/Services/UserRoleService.cs +++ b/AsbCloudInfrastructure/Services/UserRoleService.cs @@ -23,11 +23,14 @@ namespace AsbCloudInfrastructure.Services cacheDb.GetCachedTable((AsbCloudDbContext)context); } - public override async Task> GetAllAsync(CancellationToken token = default) + public override async Task> 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 GetAsync(int id, CancellationToken token = default)