forked from sanchezvem/PyroFetes
Refactored WarehouseProduct
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.WarehouseProducts;
|
||||
|
||||
public sealed class GetProductTotalQuantitySpec : Specification<WarehouseProduct>
|
||||
{
|
||||
public GetProductTotalQuantitySpec(int productId)
|
||||
{
|
||||
Query
|
||||
.Where(wp => wp.ProductId == productId);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.WarehouseProducts;
|
||||
|
||||
public sealed class GetWarehouseProductByProductIdSpec : Specification<WarehouseProduct>
|
||||
{
|
||||
public GetWarehouseProductByProductIdSpec(int productId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.ProductId == productId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user