Let\'s say I have this class:
class Person {
public int ID;
public string Name;
}
And then I have a list of Person\'s.
Use the Min extension method of LINQ:
persons.Min(p => p.ID)
EDIT:
My bad, the previous method returns only the lowest ID, so in case you'd like to use only built-in LINQ methods, here you go:
persons.Aggregate(
(personWithMinID, currentPerson) =>
currentPerson.ID <= personWithMinID.ID ? currentPerson : personWithMinID)