Learn how to use Entity Framework Core migrations to add a migration to a DbContext using code first and update a SQL Server database.
We'll create an entity for a DbContext that is added as a DbSet type. Afterwards, we'll show you how to set up configuration in Entity Framework so properties within an entity can be set.
Then we add a migration that generates a script that will be run against the database. We then proceed to update the database with our migration and show what happens once the migration has been completed.
► This is part 2 of our Get started with EF Core course. View the full playlist:
• Get started with EF Core - Full course
💻 Download the code example💻
https://www.roundthecode.com/dotnet-c...
📖 Learn .NET and C# with our online courses 📖
https://www.roundthecode.com/dotnet-c...
👨💻Take our .NET and C# coding challenges👨💻
https://www.roundthecode.com/dotnet-c...
► Chapters
0:00 What we'll cover
0:14 Create class libraries
1:26 Create entity
2:05 Create an interface for a DbContext
4:46 Add and remove migration
6:19 Add an entity type configuration
8:20 Add migration and update database
9:42 Learn more about EF Core
#efcore #migrations #entityframeworkcore
Watch video Entity Framework Core migrations: Add a migration online without registration, duration hours minute second in high quality. This video was added by user Round The Code 28 January 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 6,311 once and liked it 62 people.