Created
June 26, 2013 17:38
-
-
Save venblee/5869544 to your computer and use it in GitHub Desktop.
Including GrandChildren in .Include()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (var db = new PmsContext()) | |
{ | |
var dbresult = new Models.PurchaseOrder(); | |
dbresult = db.PurchaseOrders | |
.Include("PurchaseOrderDetail") | |
.Include("PurchaseStatus") | |
.Include("RequestedEmployee") | |
// GrandChildren | |
.Include("Supplier.PostalCode") | |
.Include("Supplier.PostalState") | |
.Include("Supplier.PostalCity") | |
// GrandChildren | |
.Include("Supplier.PhysicalCode") | |
.Include("Supplier.PhysicalState") | |
.Include("Supplier.PhysicalCity") | |
.Include("ModifyEmployee") | |
.Include("BuyerEmployee") | |
.Include("ApproverEmployee") | |
.FirstOrDefault(x => x.PurchaseOrderId == orderid); | |
return dbresult; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment