BP19: Disable lazy loading

Lazy loading means that the child objects at the end of a navigation property aren't retrieved unless you explicitly work with the navigation property in your code. If you don't need those child objects, then this is the behavior that you want because it reduces the amount of data retrieved from the database when you retrieve the parent object.

The problem of Lazy Loading is that it makes your database access very chatty. Instead of retrieving everything in single database call, you issue multiple database requess. Iterate through some lazy loaded entities in a loop and your DBA will start to hate you soon.

Comments

No Comments Yet.
Be the first to tell us what you think.

Download Better Coder application to your phone and get unlimited access to the collection of enterprise best practices.

Get it on Google Play