What's new coming up in .NET 10
.NET 10 is coming out this year, and with it, a bunch of nice features are coming; some are small, and a few are totally game-changing and powerful. As of now, per preview 2, it's bringing several enhancements across C#, ASP.NET Core, and Entity Framework (EF) Core that I would like to share today.
C# 13:
C# 13 in .NET 10 is focusing on improving code clarity and flexibility. Key features include the field keyword for direct backing field access in properties, partial properties for better code organization, and enhanced params collections to support more flexible method parameters. These updates aim to simplify coding patterns and improve maintainability.
- field Keyword: Introduced as a preview feature, the field keyword allows property accessors to reference the compiler-generated backing field directly, simplifying property implementations.
- Partial Properties: Extending the partial class concept, C# 13 supports partial properties, enabling property definitions to be split across multiple files.
- Enhanced
params
Collections: Theparams
Keyword now supports collections, allowing methods to accept a variable number of arguments as arrays or other collection types.
ASP.NET Core 10:
Blazor Enhancements: The ReconnectModal
component has been added to the Blazor Web App project template for improved reconnection UI control. Additionally, the NavigateTo
method no longer scrolls to the top for same-page navigation, and the NavLink
component now ignores query strings and fragments when using NavLinkMatch.All.
Entity Framework Core 10
- LINQ Enhancements: EF Core 10 introduces support for the
LeftJoin
operator, simplifying the implementation of left join operations in LINQ queries. ExecuteUpdateAsync
Improvements: This method now accepts regular, non-expression lambdas, making it more intuitive for developers to perform update operations asynchronously. These updates aim to enhance developer productivity and application performance. For comprehensive details, refer to the official Microsoft documentation.