public class Person
{
public int ID { get; set; }
public int Name { get; set; }
public Person(int id, string name)
{
ID = id;
Name = name;
}
}
Usage code:
//Add some objects
List
myList.Add(new Person(1, "Person 1"));
myList.Add(new Person(2, "Person 2"));
myList.Add(new Person(3, "Person 3"));
//Find a specific object
Person myLocatedObject = myList.Find(delegate(Person p) {return p.ID == 1; });
Thanks Andrey for good example (original article)