none
AsNotLazy() and AsNoProxy() methods similar to AsNoTracking() RRS feed

  • Question

  • Would it be possible to have AsNotLazy() and AsNoProxy() methods similar to AsNoTracking()? Currently we have to disable lazy loading and proxy generation in the context's Configuration. We can't disable these features on a per-query basis.

    A possible problem might be that AsNoTracking() has always been a set-level method (in the ObjectContext API as well: MergeOption), while lazy loading and proxy generation are enabled at the context level. What would happen to objects that were first fetched with AsNotLazy() and later, in the same context, without this option? This may produce object graphs that consist of lazy-loading and non-loading entities because they get connected by relationship fixup. Should the two object graphs be kept apart? I think this also happens with identical objects that are fetched with and without AsNoTracking. But keeping apart two tracked object graphs..??

    So I thought, let me ask this first before sending in a feature request.
    Thursday, January 30, 2014 9:55 PM

Answers

  • Hello,

    >>Would it be possible to have AsNotLazy() and AsNoProxy() methods similar to AsNoTracking()?

    Unfortunately, there are no these methods so far. We have to set lazy loading and proxy generation at the context level.

    If you want to the Entity Framework team consider such a feature, you can post your wish to:

    http://data.uservoice.com/forums/72025-entity-framework-feature-suggestions

    Then team members will see it.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 3, 2014 1:44 AM
    Moderator