LINQ has also gotten some attention during the development of .NET 6. Multiple new extensions have been added. Among these additions are: Support for indices and ranges when using
IEnumerable
collections, adding key selector variants for many of the existing LINQ extensions so that you can use e.g.MaxBy
orDistinctBy
, adding overloads to the extensions with defaults likeFirstOrDefault
so that you can decide the default, and a couple of other minor additions. We will go through these additions to LINQ in this article and benchmark some of them against previous approaches.
Read more: https://blog.elmah.io/new-linq-extensions-in-net-6-and-benchmarks/