-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39a02af
commit 049d6ed
Showing
7 changed files
with
73 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/api/modules/Catalog/Catalog.Application/Products/Search/v1/SearchProductSpecs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Ardalis.Specification; | ||
using FSH.Framework.Core.Paging; | ||
using FSH.Framework.Core.Specifications; | ||
using FSH.Starter.WebApi.Catalog.Application.Products.Get.v1; | ||
using FSH.Starter.WebApi.Catalog.Domain; | ||
|
||
namespace FSH.Starter.WebApi.Catalog.Application.Products.Search.v1; | ||
public class SearchProductSpecs : EntitiesByPaginationFilterSpec<Product, ProductResponse> | ||
{ | ||
public SearchProductSpecs(SearchProductsCommand command) | ||
: base(command) => | ||
Query | ||
.OrderBy(c => c.Name, !command.HasOrderBy()) | ||
.Where(p => p.Price >= command.MinimumRate!.Value, command.MinimumRate.HasValue) | ||
.Where(p => p.Price <= command.MaximumRate!.Value, command.MaximumRate.HasValue); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters