Refactor product filtering logic and add database migration for categories and tags

This commit is contained in:
masoodafar-web
2025-11-20 20:06:01 +03:30
parent 69ab91fb2b
commit b15ec93aa1
5 changed files with 1792 additions and 4 deletions

View File

@@ -18,8 +18,8 @@ public class GetAllPruductCategoryByFilterQueryHandler : IRequestHandler<GetAllP
{
query = query
.Where(x => request.Filter.Id == null || x.Id == request.Filter.Id)
.Where(x => request.Filter.ProductId == null || x.ProductId.Contains(request.Filter.ProductId))
.Where(x => request.Filter.CategoryId == null || x.CategoryId.Contains(request.Filter.CategoryId))
.Where(x => request.Filter.ProductId == null || x.ProductId==request.Filter.ProductId)
.Where(x => request.Filter.CategoryId == null || x.CategoryId==request.Filter.CategoryId)
;
}
return new GetAllPruductCategoryByFilterResponseDto

View File

@@ -18,8 +18,8 @@ public class GetAllPruductTagByFilterQueryHandler : IRequestHandler<GetAllPruduc
{
query = query
.Where(x => request.Filter.Id == null || x.Id == request.Filter.Id)
.Where(x => request.Filter.ProductId == null || x.ProductId.Contains(request.Filter.ProductId))
.Where(x => request.Filter.TagId == null || x.TagId.Contains(request.Filter.TagId))
.Where(x => request.Filter.ProductId == null || x.ProductId==request.Filter.ProductId)
.Where(x => request.Filter.TagId == null || x.TagId==request.Filter.TagId)
;
}
return new GetAllPruductTagByFilterResponseDto