Entity Framework 5 dynamic proxy lazy loading: every time access to a database with zero navigation database?

It says:

After the object has been loaded, any further requests for the object will load it directly from the Object Status Manager, regardless of whether you are using lazy loading or loading loading.

If I lazy load an object that uses the navigation property for the proxy root object, and this navigation object exists in the database, then all subsequent calls to this navigation object will not crash the database because it is already loaded.

Do I correctly assume that if I try to be lazy to load an object (or collection) using the navigation properties from the root proxy server and it does not exist in the database and, therefore, returns zero or an empty collection, all subsequent attempts to lazily load the same does an object from the same root object always lead to a database hit?

+4
source share
2 answers

No, it will not. The IsLoaded property in DbCollectionEntry<TEntity, TElement> and DbReferenceEntry<TEntity, TProperty> used to determine if a load is necessary; the actual value, whether null or not, does not matter.

+2
source

No, because it already loaded the null / empty collection value.

0
source

All Articles