Refactor all code
This commit is contained in:
@@ -3,9 +3,9 @@ using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Products;
|
||||
|
||||
public sealed class GetProductByIdSpec : Specification<Product>
|
||||
public sealed class GetProductByIdSpec : SingleResultSpecification<Product>
|
||||
{
|
||||
public GetProductByIdSpec(int? productId)
|
||||
public GetProductByIdSpec(int productId)
|
||||
{
|
||||
Query
|
||||
.Where(p => p.Id == productId)
|
||||
|
||||
@@ -9,6 +9,6 @@ public sealed class GetProductsUnderLimitSpec : Specification<Product>
|
||||
{
|
||||
Query
|
||||
.Include(p => p.QuotationProducts)
|
||||
.Where(p => p.QuotationProducts.Any(q => q.Quantity < p.MinimalQuantity));
|
||||
.Where(p => p.QuotationProducts != null && p.QuotationProducts.Any(q => q.Quantity < p.MinimalQuantity));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user