Added possibility to chain includes. (#331)

* Added possibility to chain includes.

* Removed interface.

* Removed the need for generating GUIDs as ids and added tests.
This commit is contained in:
mrukas
2019-12-16 15:42:04 +01:00
committed by Eric Fleming
parent 9695e9e3ba
commit 13fc6ea546
14 changed files with 478 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
using Microsoft.eShopWeb.ApplicationCore.Helpers.Query;
namespace Microsoft.eShopWeb.ApplicationCore.Specifications
{
@@ -7,8 +8,7 @@ namespace Microsoft.eShopWeb.ApplicationCore.Specifications
public CustomerOrdersWithItemsSpecification(string buyerId)
: base(o => o.BuyerId == buyerId)
{
AddInclude(o => o.OrderItems);
AddInclude($"{nameof(Order.OrderItems)}.{nameof(OrderItem.ItemOrdered)}");
AddIncludes(query => query.Include(o => o.OrderItems).ThenInclude(i => i.ItemOrdered));
}
}
}