Is there a scenario where eager loading is preferred over lazy loading?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You may require a fully populated object graph before passing it to another layer i.e. when working with what NHibernate refers to as detached instances.
Lazy loading only works within the context of an ISession. With aggregates any child objects would generally be loaded with the parent but you may have some scenarios where it would be inneficient to load child objects especially when they were not required to undertake any processing you were going to do.