Eager Loading

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
digitall
Posts: 4
Joined: Thu 30 Oct 2008 18:02

Eager Loading

Post by digitall » Thu 30 Oct 2008 18:08

I am currently testing out the Entity Framework support for the devart Oracle controls and am curious about something. I have setup an eager loading query with the ".Includes("TableName")" syntax and that seems to work really well. My schema has a couple of tiers though and when I step into "TableName", the tables below it do not get loaded and I am simply told 0 items exist.

Is it possible to load all the tables I want at a single time for speed (since they are all relational like the diagram below)?

Code: Select all

Master Table
     -Child Table
          -Child Table 2
          -Child Table 3
          -Child Table 4
     -Child Table 5
Basically I want to force the code to have access to all the objects in child tables 2, 3 and 4. If this works I know my company will be getting the component as it is our last hurdle. Other than this I am quite impressed with how it functions!

digitall
Posts: 4
Joined: Thu 30 Oct 2008 18:02

Post by digitall » Thu 30 Oct 2008 19:19

Nevermind, I figured out the .Include property to eager load stuff.

For those who come here with the same question you do something like this:

Code: Select all

var items = from s in datacontext.stuff.Include("ChildTable.ChildTable2") select s
[code]

This will make every object in "items" which has a child table called "ChildTable" load its' child table called "ChildTable2".

Hope this helps!

Post Reply