Posts

Showing posts from October, 2026

.NET 9 and .NET 10 LINQ Enhancements

This post walks through all five with a working console application. The demo uses an in-memory data set of 50 customers, 50 products and 50 orders, so every number printed below can be traced back to the data. Everything here targets net10.0 and runs on the .NET 10 SDK. In this post What was added The demo project The model classes The seed data .NET 9: CountBy() .NET 9: AggregateBy() .NET 9: Index() .NET 10: LeftJoin() .NET 10: RightJoin() Combining the new operators The output Three things that trip people up Summary What was added Version Method Replaces .NET 9 CountBy() GroupBy().Select(g => g.Count()) .NET 9 AggregateBy() GroupBy().Select(g => g.Sum(...)) and friends .NET 9 Index() Select((x, i) => ...) and manual counters .NET 10 LeftJoin() GroupJoin() + SelectMany() + DefaultIfEmpty() .NET 10 RightJoin() The same chain with the sequences swapped There is a theme running through the first three. GroupBy() has to materialise ev...