Querying in EF Core

Lazy Loading in Entity Framework Core

Lazy loading in Entity Framework Core allows EF Core to retrieve related data whenever it needs it. The EF Core retrieves the related data behind the scene, whenever we access the navigational property. The EF Core does not support Lazy Loading out of the box. Hence to use it we need to enable it. There are two ways you can enable Lazy Loading. One using the Proxies Package and the one by injecting ILazyLoader service. In this tutorial, we will learn how to enable Lazy Loading and how to use it.

Lazy Loading in Entity Framework Core Read More »

Explicit Loading in Entity Framework Core

Explicit Loading in EF Core is a technique we query and load the related entities with an explicit call. Explicit loading works very similar to Lazy Loading, but the loading of the related entities happens only after an explicit call to the Load or Query method of the related entity’s DbContext.Entry(…) API object. In eager loading, we query the related entities along with the main entity in a single Query. In Lazy loading, EF loads the load related entities whenever we access the related Property.

Explicit Loading in Entity Framework Core Read More »

Eager Loading using Include & ThenInclude in EF Core

In this article let us explore the Eager Loading using theInclude method in Entity Framework Core ( EF Core). The Include Lambda method is an extension method from the namespace Microsoft.EntityFrameworkCore.. We use the include & ThenInclude methods, along with the Projection Query in EF Core to load the related entities. In this tutorial, we look at include method and learn how to load entities from multiple levels and multiple tables

Eager Loading using Include & ThenInclude in EF Core Read More »

EF Core Join Query

In this tutorial let us look into how to use Join Query in EF Core to load data from two, three or more tables. The LINQ join operator allows us to join multiple tables on one or more columns (multiple columns). By default, they perform the inner join of the tables. We also learn how to perform left joins in EF Core.

EF Core Join Query Read More »

EF Core Projection Queries

This tutorial is about Projection queries in EF Core. We use them to create a query that selects specific columns from a set of entities. The projection queries create a query that selects from a set of entities in your model but returns results that are of a different type. This is also known as the query projection. The Projection Queries results can return an anonymous type or a Concrete type.

EF Core Projection Queries Read More »

Scroll to Top