From 8b80fb17e9420065bec94fc0d9d9e5b90d7ecd46 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Tue, 13 Sep 2022 15:45:15 +0500 Subject: [PATCH] #5998816 --- .../Services/WellFinalDocumentsService.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/AsbCloudInfrastructure/Services/WellFinalDocumentsService.cs b/AsbCloudInfrastructure/Services/WellFinalDocumentsService.cs index 8751a510..3885d0e3 100644 --- a/AsbCloudInfrastructure/Services/WellFinalDocumentsService.cs +++ b/AsbCloudInfrastructure/Services/WellFinalDocumentsService.cs @@ -89,10 +89,10 @@ namespace AsbCloudInfrastructure.Services .ConfigureAwait(false); var entitiesGroups = entities - .GroupBy(d => d.Category); + .GroupBy(d => d.IdCategory); var categoriesIds = entitiesGroups - .Select(g => g.Key.Id); + .Select(g => g.Key); var files = (await fileService .GetInfosByWellIdAsync(idWell, token) @@ -102,15 +102,15 @@ namespace AsbCloudInfrastructure.Services var docs = entitiesGroups.Select((g) => new WellFinalDocumentDto { - IdCategory = g.Key.Id, + IdCategory = g.Key, FilesCount = files - .Where(f => f.IdCategory == g.Key.Id) + .Where(f => f.IdCategory == g.Key) .Count(), File = files - .Where(f => f.IdCategory == g.Key.Id) + .Where(f => f.IdCategory == g.Key) .OrderBy(f => f.UploadDate) .LastOrDefault(), - NameCategory = g.Key.Name, + NameCategory = g.First().Category.Name, Publishers = g.Select(i => i.User.Adapt()), PermissionToUpload = g.Any(i => i.IdUser == idUser), });