Dotnetcore 1.1 – Entity Framework Core – Update database after making changes to the model

You may have noticed that all the blog posts make mention to commands that don’t exist. Such as update-database and other migration like commands

This is because these classes no longer exist in dotnetcore. If you want to save the changes you’ve made to a database, here are the following commands to issue in a command prompt, power shell or through VS Code

dotnet ef migrations add nameOfMigrationHere

And then run

dotnet ef database update

Check the database of your target and your changes will be there! You’ll even notice a table in your database showing the migration

Leave a Reply

Your email address will not be published. Required fields are marked *