How to perform .Max() on a property of all objects in a collection and return the object with maximum value
public class DimensionPair
{
public int Height { get; set; }
public int Width { get; set; }
}
I want to find and return the object in the list which has the largest Height
property value.
I can manage to get the highest value of the Height
value but not the object itself.
Can I do this with Linq? How?