Entity Framework Core has some great new features as part of .NET 6.
This tutorial will take a look at the new update and the changes in EF Core 6 that you can start using today for your C# application.
The features we will look at include:
● Migration bundles
When working with Entity Framework, we can use migrations to keep our SQL Server database schema in sync with the entitles and properties in our application. With .NET 6, rather than calling a PowerShell script to update the database, we can now create an executable. This allows us to run this executable as a step in our DevOps deployment pipeline.
● Temporal tables
Temporal tables were introduced in SQL Server 2016, and are designed to give a full history of changes for a table in the database. EF Core 6 adds support for temporal tables. Not only can we can create tables as temporal, but we can also query against them.
● Pre-convention model configuration
When setting properties within our entities, we sometimes want to set properties with a convention. One example would be to set all strings to have a maximum character length of 300 characters, unless explicitly specified. With Entity Framework in .NET 6, we can now do this.
💻 Download the code example for this demo 💻
https://www.roundthecode.com/dotnet-c...
📖 Learn .NET and C# with our online courses 📖
https://www.roundthecode.com/dotnet-c...
► More information: https://www.roundthecode.com/dotnet-b...
► Chapters
0:00 What EF Core updates we are looking at
0:30 Migration bundles
3:51 Temporal tables
7:24 Pre-convention model configuration
9:25 How to fix migration bundles?
#entityframework #dotnet #visualstudio2022