empty navigation property collections

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
wgkwvl
Posts: 39
Joined: Tue 20 Jul 2010 15:13

empty navigation property collections

Post by wgkwvl » Tue 11 Oct 2011 08:40

Hi,

a pure Entity Framework question :
I am using Entity Framework with self tracking entities, in a WCF client - server environment.

When i am loading an entity is do not load all sub entities, the subentities are only loaded on demand ( when opening the tab).

Now i want to sometimes access a property from another tab,
and want to know if the subentities were loaded or not.

If there is data, then it is simple : it was loaded.
If there is no data, then its either not loaded, or it was loaded but returned empty.

The only way i see to make the difference in the second scenario, is to make a boolean field for each collection 'isxxxLoaded'. And i was wondering if there is a better way ? ( even maybe if the TrackableCollections can be smart enough to keep track of that , because i would hope that EF does the same for its lazy loading mechs)

Shalex
Site Admin
Posts: 8240
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 12 Oct 2011 15:24

Thank you for your suggestion. We will improve our Self-Tracking Entity template and post here about the results.

Shalex
Site Admin
Posts: 8240
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 20 Oct 2011 10:01

We do not have a technical possibility to support the IsLoaded flag. This issue was also discussed at http://stackoverflow.com/questions/1938 ... g-entities.

Self-tracking entities are not enabled to perform lazy loading: http://msdn.microsoft.com/en-us/library/ff407090.aspx.

Post Reply