This is a migrated thread and some comments may be shown as answers.

Disable Lazy Loading

0 Answers 62 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Richard
Top achievements
Rank 1
Richard asked on 18 Jul 2017, 09:03 PM

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

Tags
Data Access Free Edition
Asked by
Richard
Top achievements
Rank 1
Share this question
or