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
Смотрите видео Entity Framework Core migrations: Add a migration онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Round The Code 28 Январь 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 6,311 раз и оно понравилось 62 людям.