Entity Framework Core 10 Preview 1 - Release Notes
February 25, 2025 ยท View on GitHub
.NET 10 Preview 1 includes new Entity Framework Core features & enhancements:
- Support for the .NET 10 LeftJoin operator
- ExecuteUpdateAsync now accepts a regular, non-expression lambda
- Several small improvements
Entity Framework Core 10 updates:
Support for the .NET 10 LeftJoin operator
LEFT JOIN is a common and useful operation when working with EF Core. In previous versions, implementing LEFT JOIN in LINQ was quite complicated, requiring SelectMany, GroupJoin and DefaultIfEmpty operations in a particular configuration:
var query = students
.GroupJoin(
departments,
student => student.DepartmentID,
department => department.ID,
(student, departmentList) => new { student, subgroup = departmentList })
.SelectMany(
joinedSet => joinedSet.subgroup.DefaultIfEmpty(),
(student, department) => new
{
student.student.FirstName,
student.student.LastName,
Department = department.Name ?? "[NONE]"
});
.NET 10 adds first-class LINQ support for LeftJoin method, making those queries much simpler to write. EF Core recognizes the new method, so it can be used in EF LINQ queries instead of the old construct:
var query = students
.LeftJoin(
departments,
student => student.DepartmentID,
department => department.ID,
(student, department) => new
{
student.FirstName,
student.LastName,
Department = department.Name ?? "[NONE]"
});
See #12793 for more details.
ExecuteUpdateAsync now accepts a regular, non-expression lambda
Creating expresion trees can be verbose, and now you can use regular, non-expression lambdas when calling ExecuteUpdateAsync:
await context.Blogs.ExecuteUpdateAsync(s =>
{
s.SetProperty(b => b.Views, 8);
if (nameChanged)
{
s.SetProperty(b => b.Name, "foo");
}
});
Thanks to @aradalvand for proposing and pushing for this change (in #32018).
Small improvements
- Translation for DateOnly.ToDateTime(timeOnly) (#35194, contributed by @mseada94).
- Optimization for multiple consecutive
LIMITs (#35384, contributed by @ranma42). - Optimization for use of
Countoperation onICollection<T>(#35381, contributed by @ChrisJollyAU). - Optimization for
MIN/MAXoverDISTINCT(#34699, contributed by @ranma42). - Make SQL Server scaffolding compatible with Azure Data Explorer (#34832, contributed by @barnuri).
- Translation for date/time functions using
DatePart.MicrosecondandDatePart.Nanosecondarguments (#34861). - Simplifying parameter names (e.g. from
@__city_0tocity) (#35200).
Everything else in Preview 1
Preview 1 contains: