What I want to do is basically
var max = things.Select(t => ExpensiveFunc(t)).Max();
var ThingWithMaxResult = things.Where(t => ExpensiveFunc(t) == max).First();
But I don't want to have to run the ExpensiveFunc
twice on each element.
I am learning LINQ so I would like to know the LINQ way of doing this. Otherwise I would normally create an array of things and results, then just pick the array with the highest result.