EntityFramework.LazyLoading icon indicating copy to clipboard operation
EntityFramework.LazyLoading copied to clipboard

Eager loading

Open Ethan-G opened this issue 8 years ago • 2 comments

UPDATE: After more digging, the extra calls are actually being caused by change tracking (on load!), which is causing the lazy loading to look up data when tracking asks for it. This is still causing problems but means what I was wondering about earlier isn't relevant.

New question: is this happening in other peoples' uses of this or is there a way around it?

Original below: I'm trying to use this with my EF Core project but based on the logs, it seems to be eager loading everything.

Can you confirm this still works? I'm not using a DBContextFactory pattern in the way your example is, and I'm confused by the seemingly unused _isLazy variable in your example code. Could either of these things be a factor?

Thanks

Ethan-G avatar Sep 18 '17 05:09 Ethan-G

Hi,

It could be possible that the change tracking logic is triggering the LazyLoading. Please provide a piece of code which triggers this behavior.

darxis avatar Sep 19 '17 19:09 darxis

Just a call to parentEntity.unloadedChildEntityList will trigger DB queries to parentEntity.secondUnrelatedUnloadedChildEntityList.

Ethan-G avatar Sep 20 '17 06:09 Ethan-G