I'm building a web application and using lazy-loading as default. I would like the application to keep going even if I "forgot" (or did it by purpose) to load some sub-entities. This will make the application robust enough to avoid NullReferenceException.
BUT - I do want to count, somehow, the number of times lazy loading happened and log it if some threshold reached (for example, if single page rendering used more than 10 lazy loading, I would like to write a WARN message to my log and monitor it, to understand bottlenecks and naive implementation).
Is there a way to easily pull it off somehow?