I am using ADO.NET Entity model with Oracle.
When I query a table, its child entities are left unloaded. I could not find how I could enforce loading. Documentation on Entities mention DeferredLoadingEnabled property but I could not find it in the generated Entity class.
Probably it is something easy. Note: I process huge amounts of data and do not want to load all the data, I need a few records but loaded completely.
Thanks
Entities: deferred loading?
The DeferredLoadingEnabled property is a property of DataContext class (LINQ to SQL), not of the ObjectContext class (LINQ to Entities).
I recommend you 2 alternatives:
1. Explicitly call the Load() method for all records you need child objects be loaded for, like in the following code example:
2. Use the Include() method:
I recommend you 2 alternatives:
1. Explicitly call the Load() method for all records you need child objects be loaded for, like in the following code example:
Code: Select all
DEPT d = (from dept in db.DEPT
where dept.DEPTNO == 10
select dept).First();
d.EMP.Load();
Code: Select all
DEPT d = (from dept in db.DEPT.Include("EMP")
where dept.DEPTNO == 10
select dept).First();