forked from ddrilling/AsbCloudServer
This commit is contained in:
parent
1fe48ee03f
commit
8b80fb17e9
@ -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),
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user