---
title: "What is Lazy, Eager, and Explicit Loading of Related Data in Entity Frameworks"  
description: "What is Lazy, Eager, and Explicit Loading of Related Data in Entity Frameworks"  
author: "Anupam Mishra"  
published: 2016-02-26  
updated: 2020-09-24  
canonical: https://www.mindstick.com/interview/22990/what-is-lazy-eager-and-explicit-loading-of-related-data-in-entity-frameworks  
category: "asp.net"  
tags: ["c#", "asp.net", "asp.net mvc"]  
reading_time: 2 minutes  

---

# What is Lazy, Eager, and Explicit Loading of Related Data in Entity Frameworks

\
There are several ways that the Entity Framework can load related data into the navigation properties of an entity:\
\
**Lazy loading.** When the entity is first read, related data isn't retrieved. However, the first time you attempt to access a navigation property, the data required for that navigation property is automatically retrieved. This results in multiple queries sent to the database — one for the entity itself and one each time that related data for the entity must be retrieved.\
**Eager loading.** When the entity is read, related data is retrieved along with it. This typically results in a single join query that retrieves all of the data that's needed. You specify eager loading by using the Include method.\
**Explicit loading**. This is similar to lazy loading, except that you explicitly retrieve the related data in code; it doesn't happen automatically when you access a navigation property. You load related data manually by getting the object state manager entry for an entity and calling the Collection.Load method for collections or the Reference.Load method for properties that hold a single entity.

## Answers

### Answer by Anupam Mishra

\
There are several ways that the Entity Framework can load related data into the navigation properties of an entity:\
\
**Lazy loading.** When the entity is first read, related data isn't retrieved. However, the first time you attempt to access a navigation property, the data required for that navigation property is automatically retrieved. This results in multiple queries sent to the database — one for the entity itself and one each time that related data for the entity must be retrieved.\
**Eager loading.** When the entity is read, related data is retrieved along with it. This typically results in a single join query that retrieves all of the data that's needed. You specify eager loading by using the Include method.\
**Explicit loading**. This is similar to lazy loading, except that you explicitly retrieve the related data in code; it doesn't happen automatically when you access a navigation property. You load related data manually by getting the object state manager entry for an entity and calling the Collection.Load method for collections or the Reference.Load method for properties that hold a single entity.


---

Original Source: https://www.mindstick.com/interview/22990/what-is-lazy-eager-and-explicit-loading-of-related-data-in-entity-frameworks

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
