Entity Framework Core

EntityType Configuration EF Core

The Fluent API is one of the preferred ways to achieve the EntityType Configurations EF Core. In our previous tutorial on Fluent API in Entity Framework Core, We showed you how to configure an entity. We put all our configurations in the DbContext class. In this tutorial, we will show how to move the configurations to separate configuration classes using the IEntityTypeConfiguration Interface.

EntityType Configuration EF Core Read More »

Cascade Delete in Entity Framework Core

Entity Framework Core Cascade Delete is one of the Referential actions. These actions specify what to do with the related rows when we delete the parent row. We can configure these actions in the database and in the EF core (Client). The options available to use are Delete the related rows (Cascade / ClientCascade), Update its Foreign Key to NULL (SetNull / ClientSetNull) or do nothing (Restrict/ NoAction / ClientNoAction). We setup delete behavior between entities using the FluentAPI OnDelete method.

Cascade Delete in Entity Framework Core Read More »

Scroll to Top