Entity Framework Core

Entity Framework Core Conventions

EF Core Conventions or the default rules that you follow while creating the entity model. The EF Core uses these to infer and to configure the Database. It uses the information available in the POCO Classes to determine and infer the schema of the database that these classes are mapped to. For example, the table name, Column Name, Data Type, Primary keys are inferred from the Class name, property name & Property type by convention to build the database

Entity Framework Core Conventions Read More »

EF Core Database First. Reverse Engineering the Database (scaffolding)

In this article, we will learn how to use Entity Framework Core with the existing database or Database First approach. The EF core only supports Code First & Database First approach. In Database First, We use the Scaffold-dbcontext to create the Model from an existing database. This is basically Reverse engineering the existing database. Once we create the entity classes, both approaches i.e. databases first & code the first approach works in the same way

EF Core Database First. Reverse Engineering the Database (scaffolding) Read More »

EF Core Migrations

In this tutorial, we look at What is Entity Framework Migration is and how to create migrations. We will build a simple console application and create two models. We will use the add-migration command to create the migration and then use the update-database command to create the database. Next, we will update the model and create another migration and update the database. Then we will revert the migration from the database and remove the migration. Finally, we will also see how to generate SQL Scripts containing the migration commands

EF Core Migrations Read More »

Scroll to Top