EF Core Migration

EF Core Script Migration

In this tutorial let us explore the script-migration in EF core to generate SQL Scripts. We can execute these SQL Scripts in the production server to bring the database in sync with the model. This is very useful when you do not have direct access to the production server. The script migration has a –idempotent option which ensures that you do not accidentally execute the script twice. This tutorial assumes that you know how to create EF Core console app and also know about EF Core migrations

EF Core Script Migration Read More »

Seed Data in EF Core

Reverse Engineer Database First Script Migration EF Core Seed data means pre-populating the database with default data. This is useful in scenarios where you want to provide some test data in the development environment. You could use this to set up the application for the first time in a production environment by providing the sample or

Seed Data in EF Core 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