Configure One-to-One relationship using Fluent API in Entity Framework Core

Last Updated: November 2, 2018

fluent api one to one ef core

Here you will learn how to configure One-to-One relationship using Fluent API. But generally speaking, you don’t need Fluent API to do this as the EF Core Conventions will automatically create the One-to-One relationship between entities. (more…)

Configure One-to-Many relationship using Fluent API in Entity Framework Core

Last Updated: October 30, 2018

fluent api one to many relationship

Entity Framework Core makes it very easy for us to configure relationships using Fluent API. In this tutorial I will explain how to configure One-to-Many relationship using Fluent API. (more…)

Fluent API in Entity Framework Core

Last Updated: October 27, 2018

fluent api ef core

You can override the default conventions of Entity Framework Core using Fluent API. By using it, you can configure many different things, as it provides more configuration options than Data Annotation Attributes. Also, Fluent API configurations have higher precedence than data annotation attributes. (more…)

Configurations in Entity Framework Core

Last Updated: October 23, 2018

configurations ef core

In the previous tutorial I explained the Conventions in EF Core. If you want to override the conventions then apply the configurations and customize the EF model to database mappings. (more…)

Conventions in Entity Framework Core

Last Updated: October 20, 2018

conventions ef core

Conventions in Entity Framework core are the default rules by which the Database schemas are created based on domain and context classes. (more…)

Delete Records in Entity Framework Core

Last Updated: October 15, 2018

delete records ef core

EF Core API builds and executes the DELETE statement in the database for the entities whose EntityState is set as ‘Deleted’. The method DbContext.Remove() is used for deleting entity. (more…)

Update Records in Entity Framework Core

Last Updated: October 13, 2018

update records ef core

The Entity Framework Core executes UPDATE statement in the database for the entities whose EntityState is Modified. The DbContext tracks of all entities and those that are modified it sets there EntityState as modified. (more…)

Read Records in Entity Framework Core

Last Updated: November 27, 2018

read records ef core

Reading data from database in Entity Framework Core is quite easy. The below code will load the employee with name ‘Matt’. (more…)

Insert Records in Entity Framework Core

Last Updated: October 12, 2018

insert records ef core

CRUD Operations can be easily performed by Entity Framework Core. EF Core executes Insert Operation for the entities whose EntityState is Added when the DbContex.SaveChanges() method is called. (more…)

Migrations in Entity Framework Core

Last Updated: August 24, 2018

migrations ef core

Using Migrations you can keep the database synchronized with the domain (entity) classes. When developing a project the programmers keep on updating the entity classes. Therefore they need to run migrations to keep the database schema up to date. Migration commands can be execute in NuGet Package Manager Console or in dotnet Command Line Interface (CLI). (more…)