I have an application which was initially developed with a very tight deadline, so lazy loading was employed to have a product out the door faster. Well, now performance is a concern and I'm taking some care to go through and explicitly load properties, given that the biggest performance bottleneck by a longshot is pages doing hundreds of database queries thanks to lazy loading. My problem is that for some pages, since I've turned on tracing of each query, I can see that quite a few queries are made, but I can't tell why.
What I would like is a way to spot the code that is causing this. In my ideal world, I could just click something and have "break on database query triggered." Is it possible?