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), });