Creating the database

During the development phase of any application, there is a fairly high probability that your data model can change. When that happens, your EF Core model differs from the database schema and you have to delete the outdated database and create a new one based on the updated model.

This is all fun and games until you've done your first live implementation and your application runs in a production environment. You cannot then go and drop a database just to change a few columns. You have to make sure the live data persists when you make any changes.

Entity Framework Core Migrations is a nifty feature that enables us to make changes to the database schema instead of recreating the database and losing production data. There ...

Get C# 7 and .NET Core 2.0 Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.