forked from sanchezvem/PyroFetes
Adapted Price Endpoints
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Prices;
|
||||
|
||||
public sealed class GetPriceByProductIdAndSupplierIdSpec : Specification<Price>
|
||||
{
|
||||
public GetPriceByProductIdAndSupplierIdSpec(int? productId, int? supplierId)
|
||||
{
|
||||
Query
|
||||
.Where(p => p.ProductId == productId && p.SupplierId == supplierId);
|
||||
}
|
||||
}
|
||||
13
PyroFetes/Specifications/Products/GetProductByIdSpec.cs
Normal file
13
PyroFetes/Specifications/Products/GetProductByIdSpec.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Products;
|
||||
|
||||
public sealed class GetProductByIdSpec : Specification<Product>
|
||||
{
|
||||
public GetProductByIdSpec(int? productId)
|
||||
{
|
||||
Query
|
||||
.Where(p => p.Id == productId);
|
||||
}
|
||||
}
|
||||
13
PyroFetes/Specifications/Suppliers/GetSupplierByIdSpec.cs
Normal file
13
PyroFetes/Specifications/Suppliers/GetSupplierByIdSpec.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Ardalis.Specification;
|
||||
using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Suppliers;
|
||||
|
||||
public sealed class GetSupplierByIdSpec : Specification<Supplier>
|
||||
{
|
||||
public GetSupplierByIdSpec(int? supplierId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.Id == supplierId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user