You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what I've noticed, this setting forces me to have my navigation properties marked as "virtual". In one of my entities, I have 3 navigation properties, but I want to enable Lazy loading in just two of them (I would not like to implement ILazyLoader, as it would "dirty" my domain). If I'm not mistaken, in EF 6.x this was possible by omitting the "virtual" markup on the navigation property.
In short, I would like to leave Lazy loading enabled, but choose on which property it will work without having to implement ILazyLoader in my entity. Is that already possible? If not, I believe that using the "virtual" markup as the criterion of lazy loading on certain navigation properties would be very good.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
@andreluizsecco Configuration of only specific navigation properties is tracked by #10787, which is currently on the backlog. We don't plan to pivot this behavior using virtual because that was a common source of errors/confusion in classic EF--it's very easy to miss a virtual and not notice.
I have a problem in this scenario that is when i use the Include method on a lazy property and i store the result in a static cache, like ObjectCache.
The lifetime scope of my application is per request including and the DbContext. So, if i store the result of my query in a static cache with proxy lazy properties, when i refresh the page i get a Microsoft.EntityFrameworkCore.Infrastructure.LazyLoadOnDisposedContextWarning
exception.
I think that was must be possible to disable the proxies in this scenario to make this works in sub sequents requests.
In this case, if i disable the lazy loading, all things works.
There is a way to make this running without disable all lazy loading?
Hello,
I'm testing the lazy loading in EF Core (preview1-final version), leaving it enabled by default in my DbContext.
Ex:
From what I've noticed, this setting forces me to have my navigation properties marked as "virtual". In one of my entities, I have 3 navigation properties, but I want to enable Lazy loading in just two of them (I would not like to implement ILazyLoader, as it would "dirty" my domain). If I'm not mistaken, in EF 6.x this was possible by omitting the "virtual" markup on the navigation property.
In short, I would like to leave Lazy loading enabled, but choose on which property it will work without having to implement ILazyLoader in my entity. Is that already possible? If not, I believe that using the "virtual" markup as the criterion of lazy loading on certain navigation properties would be very good.
Thanks in advance.
The text was updated successfully, but these errors were encountered: