Upgrade to use Specification 4.0.0 (#444)

This commit is contained in:
Steve Smith
2020-07-31 14:52:14 -04:00
committed by GitHub
parent e520126857
commit 754c845e9f
15 changed files with 63 additions and 52 deletions

View File

@@ -3,16 +3,20 @@ using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate;
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
{
public sealed class BasketWithItemsSpecification : BaseSpecification<Basket>
public sealed class BasketWithItemsSpecification : Specification<Basket>
{
public BasketWithItemsSpecification(int basketId) : base(b => b.Id == basketId)
public BasketWithItemsSpecification(int basketId)
{
AddInclude(b => b.Items);
Query
.Where(b => b.Id == basketId)
.Include(b => b.Items);
}
public BasketWithItemsSpecification(string buyerId) : base(b => b.BuyerId == buyerId)
public BasketWithItemsSpecification(string buyerId)
{
AddInclude(b => b.Items);
Query
.Where(b => b.BuyerId == buyerId)
.Include(b => b.Items);
}
}
}