Files
eShopOnWeb-chisel-demo/src/ApplicationCore/Specifications/CustomerOrdersWithItemsSpecification.cs
mrukas 13fc6ea546 Added possibility to chain includes. (#331)
* Added possibility to chain includes.

* Removed interface.

* Removed the need for generating GUIDs as ids and added tests.
2019-12-16 07:42:04 -07:00

15 lines
517 B
C#

using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
using Microsoft.eShopWeb.ApplicationCore.Helpers.Query;
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
{
public class CustomerOrdersWithItemsSpecification : BaseSpecification<Order>
{
public CustomerOrdersWithItemsSpecification(string buyerId)
: base(o => o.BuyerId == buyerId)
{
AddIncludes(query => query.Include(o => o.OrderItems).ThenInclude(i => i.ItemOrdered));
}
}
}