Open maleet opened 8 years ago
Not the best example from me as something similar is explained here: https://github.com/MikaelEliasson/EntityFramework.Utilities/issues/14
My query is following:
var purchaseOrderHeader = Entities.PurchaseOrderHeaderDetails
.Include(x => x.PurchaseOrderType)
.IncludeEFU(Entities, x => x.PurchaseOrderLines
.Select(line => line.PurchaseOrderProcedureActivities))
.IncludeEFU(Entities, x => x.PurchaseOrderLines
.Select(l => l.ItemDetailHeaders
.Select(pdh => pdh.ItemDetailLines)))
.IncludeEFU(Entities, x => x.PurchaseOrderLines
.Select(l => l.PurchaseOrderLineAllocations
.Select(pola => pola.ItemDetailHeaders
.Select(header => header.ItemDetailLines))))
.FirstOrDefault(x => x.Id == id);
Here PurchaseOrderHeaderDetails have list of PurchaseOrderLines and PurchaseOrderLine have list of PurchaseOrderProcedureActivities
This kind of linq-supported-include is not imported by IncludeEFU.
Plain LinqToEntity:
var firstOrDefault = db.Comments.Include(x => x.Publication.Comments.Select(comment => comment.Address)).FirstOrDefault();
With IncludeEFU:
var firstOrDefault = db.Comments.IncludeEFU(db, x => x.Publication.Comments.Select(comment => comment.Address)).FirstOrDefault();
Can I do Include children of children?