I would like to get ALL elements in enumerable whose property is the maximum :
IEnumerable<Person> allOldest = people.GroupBy(p => p.Age)
.OrderByDescending(i=>i.Key).First().Select(_=>_);
.NET 6 introduce MaxBy which return THE max item:
Person uniqueOldest = people.MaxBy(person => person.Age);
MaxBy can't help me ?
Is there another more elegant solution than first example?