Make DbCollectionEntry, DbReferenceEntry.IsLoaded settable


I want to be able to write something like this:

db.Entry(room).Collection(r => r.Users).IsLoaded = true;
room.Users.Add(user); // this doesn't trigger lazy loading because i already marked the collection as loaded. Without this, I have to turn off lazy loading in the whole context.
Closed Mar 28, 2013 at 11:31 PM by lukew
Verified change


matra wrote Feb 22, 2013 at 5:27 AM

See also a more detail description of use case in http://entityframework.codeplex.com/workitem/884. Please make this also available for ObjectContext and RelatedEnd (EntityCollection<T>). Thanks

ajcvickers wrote Mar 27, 2013 at 8:40 PM

Fixed in 4309478f959b

LoadedWithHits (Make IsLoaded settable)

This change makes IsLoaded settable. It does not change any of the semantics around the flag, including cases where the flag is reset such as on FK change or entity detachment.