Skip to content

Commit

Permalink
fix(category):debug get category (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirRezaZahedi authored Aug 28, 2024
1 parent c0df4de commit b82b1fb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1,133 deletions.
21 changes: 15 additions & 6 deletions AnalysisData/AnalysisData/EAV/Service/CategoryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,22 @@ public async Task<Category> GetCategoryByIdAsync(int id)

private async Task<IEnumerable<CategoryDto>> MakeCategoryDto(IEnumerable<Category> categories)
{
var categoryDtoTasks = categories.Select(async category => new CategoryDto
var categoryDtoList = new List<CategoryDto>();

foreach (var category in categories)
{
Id = category.Id,
Name = category.Name,
TotalNumber = await _uploadDataRepository.GetNumberOfFileWithCategoryIdAsync(category.Id)
});
var totalNumber = await _uploadDataRepository.GetNumberOfFileWithCategoryIdAsync(category.Id);

var categoryDto = new CategoryDto
{
Id = category.Id,
Name = category.Name,
TotalNumber = totalNumber
};

categoryDtoList.Add(categoryDto);
}

return await Task.WhenAll(categoryDtoTasks);
return categoryDtoList;
}
}
Loading

0 comments on commit b82b1fb

Please sign in to comment.