views:

82

answers:

0

Hi, I'm trying out EF4 as part of a .Net 4.0 WCF service. The aim of the service is to return document data as an array of entity objects to any of our ASP.Net apps. The apps are still in .Net 2.0. Due to the nature of the solution I've disabled LazyLoading at context level. I started with this:

var revQuery = from revs in context.tbl_Document_Revision
                       where (revs.ID == myIDVar)
                       select revs;

Everything works ok, I receive the correct number of populated objects. However when I add an Include into my query to allow us to pickup fields from a related table that has a defined navigation only the first record is returned fully populated to a calling application:

var revQuery = from revs in context.tbl_Document_Revision.Include("tbl_Staff")
                       where (revs.ID == myIDVar)
                       select revs;

The array is the correct size but all elements after the first are blank, default placeholders. Its like using the Include has reverted to LazyLoading and I can't seem to kick it into line. Anyone else had this problem?