using System.Collections.Generic;
public string firstName, lastName;
public Person(string firstName, string lastName)
this.firstName = firstName;
this.lastName = lastName;
public override string ToString()
return this.firstName + " " + this.lastName;
public static void Main()
List<Person> people = new List<Person>() {
new Person("Georgi", "Test"),
new Person("Georgi", "Arz"),
new Person("Stamat", "Djiri"),
new Person("Arin", "Arno")
var lambdaOrder = people.OrderBy(person => person.firstName)
.ThenBy(person => person.lastName);
orderby person.firstName, person.lastName
Console.WriteLine("Unsorted:");
foreach(Person person in people)
Console.WriteLine(person);
Console.WriteLine("Lambda:");
foreach(Person person in lambdaOrder)
Console.WriteLine(person);
Console.WriteLine("Linq:");
foreach(Person person in linqOrder)
Console.WriteLine(person);