Disable Lazy Loading

Thread is closed for posting
1 posts, 0 answers
  1. Richard
    Richard avatar
    1 posts
    Member since:
    Jul 2017

    Posted 18 Jul 2017 Link to this post

    Hi

    Is there any way to disable lazy loading globally for all objects?

    I'm trying to trace down "chatty" multiple requests to the database (n+1 anti-pattern etc), and am seeing lots of these calls in a profiler, but I have no easy way to see where the call came from. If I were using Entity Framework, I would disable lazy loading, so that instead of these objects being loaded from the database, I'd get a null reference exception instead, which shows me immediately where the load happens so I can modify the query appropriately.

    Thanks

    Richard

Back to Top