Two new LINQ methods in .NET 9: CountBy and Index

from blog Just Some Code, | ↗ original
LINQ doesn’t get new features with each release of the .NET framework. It just simply works. This time, .NET 9 introduced two new LINQ methods: CountBy() and Index(). Let’s take a look at them. 1. CountBy CountBy groups the elements of a collection by a key and counts the occurrences of each key. With CountBy, there’s no need to first group the...