views:

42

answers:

2

Hi folks,

i'm trying to eager load some child entity, and when I try to add the Include() method, i'm getting a compiler error (ie. it can't find it).

alt text

er ... can anyone help me out on this one, please?

A: 

As far as I can tell, Include() is not a method of IObjectSet, not of any interface it extends:

http://msdn.microsoft.com/en-us/library/dd642094(VS.100).aspx

Include is a member of ObjectQuery (it also returns a ObjectQuery), so you need a ObjectQuery object to start with.

James Curran
+3  A: 

Have a look at this post by Julie Lerman Agile Entity Framework 4 Repository Part 5: IObjectSet and Include

Luhmann
Perfect - cheers!
Pure.Krome