This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
{ | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
} | |
List<Person> list = new List<Person>(); | |
list.Add(new Person() { FirstName = "Mike", LastName = "Smith" }); | |
list.Add(new Person() { FirstName = "John", LastName = "Fiolkowsky" }); | |
list.Add(new Person() { FirstName = "Andrew", LastName = "Dawson" }); | |
list.Sort((p1, p2) => p1.LastName.CompareTo(p2.LastName)); |