Hi,
I've got a test project for EF 4.0, we are considering buying LLBLGen Pro very soon.
When generating the V1 code, lazy loading works as it should.
But when I choose to create an EF4 POCO Self-tracking solution, lazy loading does not work.
In my example, it always returns 0 as count for CostBudgets.Count.
And Can I force a load on a POCO-object (the .Load method does not exist)?
OCWEF4DataContext newContext = new OCWEF4DataContext(GetEntityConnection());
newContext.ContextOptions.LazyLoadingEnabled = true;
//List<CostCenter> cc = newContext.CostCenters.ToList();
foreach (Systemat.Software.OCW.EntityClasses.CostCenter item in newContext.CostCenters)
{
System.Diagnostics.Trace.WriteLine(item.CostCenterName.ToString());
//item.CostBudgets.Load();
System.Diagnostics.Trace.WriteLine(item.CostBudgets.Count().ToString());
}
This same example in the project EF4.0 v1, the lazy loading & load function works as it should.
I'm pretty sure lazy loading is supported on POCO-classes in EF4.
I also tried checking the EnableProxyCreationOnContext, but that didn't help either.
Any idea's ???
Regards,
Sven Peeters