Click here to Skip to main content
12,999,837 members (54,024 online)
Rate this:
 
Please Sign up or sign in to vote.
Sample class structure
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; }
}


In order to populate order object with all navigational properties, I wrote
context.Orders.Include("Details").Include("Details.Item")


I also want to load MoreDetail object, hence I tried
context.Orders.Include("Details").Include("Details.Item.Detail")


It didn't work. How to load complete Order object?
Posted 16-Aug-12 7:47am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.170624.1 | Last Updated 16 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100