Newer
Older
TestingWithoutInterfaces / src / ApplicationCore / Specifications / CustomerOrdersWithItemsSpecification.cs
@Derek Comartin Derek Comartin on 5 Dec 2022 451 bytes Init
using Ardalis.Specification;
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;

namespace Microsoft.eShopWeb.ApplicationCore.Specifications;

public class CustomerOrdersWithItemsSpecification : Specification<Order>
{
    public CustomerOrdersWithItemsSpecification(string buyerId)
    {
        Query.Where(o => o.BuyerId == buyerId)
            .Include(o => o.OrderItems)
                .ThenInclude(i => i.ItemOrdered);
    }
}