Class structure example
class Order { public int Id { get; set; } public DateTime Date { get; set; } public List<OrderDetail> Details { get; set; } } class OrderDetail { public int Id { get; set; } public int Qty { get; set; } public Item Item { get; set; } } class Item { public int Id { get; set; } public string Name { get; set; } } class ElectronicItem : Item { public MoreDetail Detail { get; set; } } class MoreDetail { public int Id { get; set; } public string SomeData { get; set; } }
To fill the order object with all the navigation properties, I wrote
context.Orders.Include("Details").Include("Details.Item")
I also want to load the MoreDetail object, so I tried
context.Orders.Include("Details").Include("Details.Item.Detail")
This did not work. How to download a complete order item?
source share