forked from sanchezvem/pyrofetes-backend
Refactor all code
This commit is contained in:
@@ -3,11 +3,16 @@ using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.WarehouseProducts;
|
||||
|
||||
public sealed class GetWarehouseProductByProductIdSpec : Specification<WarehouseProduct>
|
||||
public sealed class GetWarehouseProductByProductIdSpec : SingleResultSpecification<WarehouseProduct>
|
||||
{
|
||||
public GetWarehouseProductByProductIdSpec(int productId)
|
||||
public GetWarehouseProductByProductIdSpec(int productId, int? warehouseId = null)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.ProductId == productId);
|
||||
|
||||
if (warehouseId.HasValue)
|
||||
{
|
||||
Query.Where(x => x.WarehouseId == warehouseId.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user