Refactor all code
This commit is contained in:
@@ -3,12 +3,13 @@ using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Quotations;
|
||||
|
||||
public sealed class GetQuotationByIdSpec : Specification<Quotation>
|
||||
public sealed class GetQuotationByIdSpec : SingleResultSpecification<Quotation>
|
||||
{
|
||||
public GetQuotationByIdSpec(int quotationId)
|
||||
{
|
||||
Query
|
||||
.Include(q => q.QuotationProducts)
|
||||
.Include(x => x.QuotationProducts!)
|
||||
.ThenInclude(x => x.Product)
|
||||
.Where(x => x.Id == quotationId);
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,13 @@ using PyroFetes.Models;
|
||||
|
||||
namespace PyroFetes.Specifications.Quotations;
|
||||
|
||||
public class GetQuotationByIdWithProductsSpec : Specification<Quotation>
|
||||
public class GetQuotationByIdWithProductsSpec : SingleResultSpecification<Quotation>
|
||||
{
|
||||
public GetQuotationByIdWithProductsSpec(int quotationId)
|
||||
{
|
||||
Query
|
||||
.Where(q => q.Id == quotationId)
|
||||
.Include(q => q.QuotationProducts!)
|
||||
.ThenInclude(qp => qp.Product);
|
||||
.Where(x => x.Id == quotationId)
|
||||
.Include(x => x.QuotationProducts!)
|
||||
.ThenInclude(p => p.Product);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user