using System.Collections.Generic;
public static void Main()
BirthDay = new DateTime(1986,1,17),
BirthDay = new DateTime(1988,1,17),
BirthDay = new DateTime(1987,1,17),
BirthDay = new DateTime(1986,1,17),
BirthDay = new DateTime(1986,1,17),
BirthDay = new DateTime(1988,1,17),
BirthDay = new DateTime(1987,1,17),
var orderedList = list.OrderByList(t => t.Name, "Mathias", "Robbe", "Simon");
foreach(var thingy in orderedList)
Console.WriteLine(thingy.Name);
public string Name{get;set;}
public DateTime BirthDay{get;set;}
public int Count{get;set;}
public static class EnumerableExtensions
public static IEnumerable<TSource> OrderByList<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> selector, params TKey[] list)
return source.OrderBy(s => Array.IndexOf(list, selector.Invoke(s)));