๐ Announcing Entity Framework Core 5.0 Preview 4
๐ก Newskategorie: Programmierung
๐ Quelle: devblogs.microsoft.com
Today we are excited to announce the fourth preview release of Entity Framework Core (EF Core) 5.0.
The fourth previews of .NET 5 and ASP.NET Core 5.0 are also available now.
Be sure to check out the full release of Blazor WebAssembly 3.2.0!
Prerequisites
The previews of EF Core 5.0 require .NET Standard 2.1. This means:
- EF Core 5.0 runs on .NET Core 3.1; it does not require .NET 5.
- This may change in future previews depending on how the plan for .NET 5 evolves.
- EF Core 5.0 runs on other platforms that support .NET Standard 2.1.
- EF Core 5.0 will not run on .NET Standard 2.0 platforms, including .NET Framework.
How to get EF Core 5.0 previews
EF Core is distributed exclusively as a set of NuGet packages.
For example, to add the SQL Server provider to your project, you can use the following command using the dotnet tool:
dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 5.0.0-preview.4.20220.10
The EF Core packages published today are:
- Microsoft.EntityFrameworkCore โ The main EF Core package
- Microsoft.EntityFrameworkCore.SqlServer โ Database provider for Microsoft SQL Server and SQL Azure
- Microsoft.EntityFrameworkCore.Sqlite โ Database provider for SQLite
- Microsoft.EntityFrameworkCore.Cosmos โ Database provider for Azure Cosmos DB
- Microsoft.EntityFrameworkCore.InMemory โ The in-memory database provider
- Microsoft.EntityFrameworkCore.Tools โ EF Core PowerShell commands for the Visual Studio Package Manager Console
- Microsoft.EntityFrameworkCore.Design โ Shared design-time components for EF Core tools
- Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite โ SQL Server support for spatial types
- Microsoft.EntityFrameworkCore.Sqlite.NetTopologySuite โ SQLite support for spatial types
- Microsoft.EntityFrameworkCore.Proxies โ Lazy-loading and change-tracking proxies
- Microsoft.EntityFrameworkCore.Abstractions โ Decoupled EF Core abstractions
- Microsoft.EntityFrameworkCore.Relational โ Shared EF Core components for relational database providers
- Microsoft.EntityFrameworkCore.Analyzers โ C# analyzers for EF Core
- Microsoft.EntityFrameworkCore.Sqlite.Core โ Database provider for SQLite without a packaged native binary
We have also published the 5.0 preview 4 release of the Microsoft.Data.Sqlite.Core ADO.NET provider.
Installing dotnet ef
As with EF Core 3.0 and 3.1, the dotnet ef command-line tool is no longer included in the .NET Core SDK. Before you can execute EF Core migration or scaffolding commands, youโll have to install this package as either a global or local tool.
To install the preview tool globally, first uninstall any existing version with:
dotnet tool uninstall --global dotnet-ef
Then install with:
dotnet tool install --global dotnet-ef --version 5.0.0-preview.4.20220.10
Itโs possible to use this new version of dotnet ef with projects that use older versions of the EF Core runtime.
Whatโs new in EF Core 5 Preview 4
We maintain documentation covering new features introduced into each preview.
Some of the highlights from preview 4 are called out below. This preview also includes several bug fixes.
Configure database precision/scale in model
Precision and scale for a property can now be specified using the model builder.
For example:
modelBuilder
.Entity<Blog>()
.Property(b => b.Numeric)
.HasPrecision(16, 4);
Precision and scale can still be set via the full database type, such as โdecimal(16,4)โ.
Documentation is tracked by issue #527.
Specify SQL Server index fill factor
The fill factor can no be specified when creating an index on SQL Server.
For example:
modelBuilder
.Entity<Customer>()
.HasIndex(e => e.Name)
.HasFillFactor(90);
Documentation is tracked by issue #2378.
Daily builds
EF Core previews are aligned with .NET 5 previews. These previews tend to lag behind the latest work on EF Core. Consider using the daily builds instead to get the most up-to-date EF Core features and bug fixes.
As with the previews, the daily builds do not require .NET 5; they can be used with GA/RTM release of .NET Core 3.1.
Documentation and feedback
EF Core docs has a new landing page! The main page for Entity Framework documentation has been overhauled to provide you with a hub experience. We hope this new format helps you find the documentation you need faster and with fewer clicks.
The starting point for all EF Core documentation is docs.microsoft.com/ef/.
Please file issues found and any other feedback on the dotnet/efcore GitHub repo.
Helpful Short Links
The following short links are provided for easy reference and access.
Main documentation:
https://aka.ms/efdocs
Issues and feature requests for EF Core:
https://aka.ms/efcorefeedback
Entity Framework Roadmap:
https://aka.ms/efroadmap
Whatโs new in EF Core 5.x?
https://aka.ms/efcore5
Thank you from the team
A big thank you from the EF team to everyone who has used EF over the years!
Arthur Vickers |
Andriy Svyryd |
Brice Lambson |
Jeremy Likness |
lajones |
Maurycy Markowski |
Shay Rojansky |
Smit Patel |
Thank you to our contributors!
A big thank you to the following community members who have already contributed code or documentation to the EF Core 5 release! (List is in chronological order of first contribution to EF Core 5).
The post Announcing Entity Framework Core 5.0 Preview 4 appeared first on .NET Blog.
...