Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET Framework entity
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
0 OriginalGriff 6,631
1 Sergey Alexandrovich Kryukov 6,345
2 CPallini 5,230
3 George Jonsson 3,574
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web03 | 2.8.140921.1 | Last Updated 16 Aug 2012
Copyright © CodeProject, 1999-2014
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