This commit is contained in:
ai.astrakhantsev 2022-09-13 15:45:15 +05:00
parent 1fe48ee03f
commit 8b80fb17e9

View File

@ -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<UserDto>()),
PermissionToUpload = g.Any(i => i.IdUser == idUser),
});