In Lazy Loading the data from the Main
table gets loaded first in the initial load, but the data from the related
tables are not loaded, they get loaded only when we access the Navigational
property from the main table. To perform Lazy loading we need to enable Lazy
Loading while initializing the DBContext.
Lazy Loading was introduced in EF Core 2.1. To enable lazy loading we need to install the Microsoft.EntityFrameworkCore.Proxies package and enable it with a call to UseLazyLoadingProxies.
Let us start by installing the Microsoft.EntityFrameworkCore.Proxies package.
Lazy Loading was introduced in EF Core 2.1. To enable lazy loading we need to install the Microsoft.EntityFrameworkCore.Proxies package and enable it with a call to UseLazyLoadingProxies.
Let us start by installing the Microsoft.EntityFrameworkCore.Proxies package.