add version 0.17.17.24

release
Amir Hossein Khademi 2024-02-25 23:31:55 +03:30
parent 77c56f003a
commit 3da4aad198
3 changed files with 11 additions and 7 deletions

View File

@ -1 +1 @@
0.17.16.23
0.17.17.24

View File

@ -21,10 +21,11 @@ public class GetBrandsQueryHandler : IRequestHandler<GetBrandsQuery, List<BrandS
{
//var products = await _mediator.Send(new GetProductsQuery(BrandIds: null,SpecialOffer: null, Page:0, SortBy: QuerySortBy.None,CategoryId: request.CategoryId, IsActive : null),
// cancellationToken);
var brandGrouped = _repositoryWrapper.SetRepository<Product>()
var brandGrouped = await _repositoryWrapper.SetRepository<Product>()
.TableNoTracking
.Where(p => p.CategoryId == request.CategoryId)
.GroupBy(p=>p.BrandId);
.GroupBy(p=>p.BrandId)
.ToListAsync(cancellationToken);
foreach (var grouping in brandGrouped)
{
if (grouping.Key != default)

View File

@ -66,16 +66,19 @@ public class GetProductsQueryHandler : IRequestHandler<GetProductsQuery, GetProd
response.Pager.TotalItems = await products.CountAsync(cancellationToken);
response.Pager.TotalPage = response.Pager.TotalItems % 20 == 0 ? response.Pager.TotalItems / 20 : (response.Pager.TotalItems / 20) + 1;
if(await products.AnyAsync(cancellationToken))
{
response.Filters.Price.MaximumValue = await products.MaxAsync(p => p.Cost, cancellationToken);
response.Filters.Price.MinimumValue = await products.MinAsync(p => p.Cost, cancellationToken);
}
List<ProductSDto> productSDtos = await products
.Skip(request.Page * 20)
.Take(20)
.Select(ProductMapper.ProjectToSDto)
.ToListAsync(cancellationToken);
response.Filters.Price.MaximumValue = await products.MaxAsync(p => p.Cost,cancellationToken);
response.Filters.Price.MinimumValue = await products.MinAsync(p => p.Cost,cancellationToken);
foreach (var productSDto in productSDtos)
{