Page 1 of 1

empty navigation property collections

Posted: Tue 11 Oct 2011 08:40
by wgkwvl
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)

Posted: Wed 12 Oct 2011 15:24
by Shalex
Thank you for your suggestion. We will improve our Self-Tracking Entity template and post here about the results.

Posted: Thu 20 Oct 2011 10:01
by Shalex
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.