Learn how the purpose of migrations is to update the database schema, instead of dropping and recreating the database. It keeps your DB in sync with your models. Then find a file created under a Migrations folder, which lays out how the DB schema should be designed.
- [Instructor] Now that you have your Actor model,…you can use migrations to create to database,…especially since we've also configured…our connection string.…The purpose of migrations,…is to update the database schema…instead of dropping and recreating it manually.…So in short, it keeps your database…in sync with your models.…And to do this, we'll go to…Tools, NuGet Package Manager…and open your Package Manager Console,…if it's not already open.…Now I already have it open.…But that's the way you can navigate to it.…
And again, there's a quick launch…that you could also just type in package,…and it should be one of the first options up there.…But in the console, let's go ahead and type in…Add, I'll hit the tab key…IntelliSense gives me Migrations as an option,…I'll choose that, and I'll enter in Initial…Migration since this is the first time…we're doing this.…And what this is going to do,…is scaffold a migration to create…the initial set of tables for your model.…Now it's not going to do anything to the database yet,…
- Entity Framework (EF) overview
- Uses for EF
- Installing EF
- Creating entities
- Creating the DbContext
- Performing migrations
- Creating an MVC application
- Installing EF packages
- Reverse engineering the model
- Performing context and dependency injection
- Creating the controller and the view
- Using SqlServerTypeMapper
Skill Level Intermediate
Q: This course was updated on 06/23/2017. What changed?
A: The following topics were updated: using the exercise files; Mac install prerequisites; Entity Framework on Mac, part 1; and Entity Framework on Mac, part 2.