Option #2 - drop and recreate

If we go for option #2, we will lose all our existing data; however, it will be recreated by the DbSeeder at the first run, so we'll only lose what we did during our CRUD-based tests during the last three chapters.

Although it might seem a horrible way to fix things, that's definitely not the case; we're still in the development phase, hence we can definitely allow a full database refresh.

Should we choose to take this bus, here are the commands to use:

dotnet ef database drop
dotnet ef database update

The drop command should ask for a Y/N confirmation before proceeding; when it does, hit the y key and let it happen. When the drop and the update tasks are both done, we can run our project in debug mode and wait ...

Get ASP.NET Core 2 and Angular 5 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.