Enabling Code First Migration
To work with the Web API, you need to implement the Code First Migrations tool. Code First Migrations is very useful when you work on a new data model that changes frequently when you develop a new application. It basically allows you to update a database with only changes you made to the data model, which means you don’t need to drop and re-create the database every time; this ensures that your data model and the database are in sync. Even though you are working with an existing, well-designed database in this case, you must enable Code First Migrations. To do this, in the Package Manager Console type the following line:
Enable-migrations
This adds a new Configuration class to the project, which is responsible for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access