2. maart 2013 10:05 by martijn in
An elegant solution is so simple that something seems to be missing. I had that feeling when I found this solution of taking a random subset of a set of items:
public static IEnumerable<T> TakeRandom<T>(this IEnumerable<T> list, int count)
{
var shuffledList = list.OrderBy(l => Guid.NewGuid());
return shuffledList.Take(count);
}