Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am alibaabaa on github.
  • I am tomeggington (https://keybase.io/tomeggington) on keybase.
  • I have a public key ASDqcKWABbCl_uvOhlWo8NIXSoFhg1KflS0UibwMm5DLNgo

To claim this, I am signing this object:

@alibaabaa
alibaabaa / gist:2477970
Created April 24, 2012 08:40
Adds direct predicate support to ToList() to avoid LINQ chaining on Func(x).ToList()
/// <summary>
/// Adds direct predicate support to ToList() to avoid
/// linq chaining on Func(x).ToList()
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source"></param>
/// <param name="predicate"></param>
/// <returns></returns>
public static List<T> ToList<T>(this IEnumerable<T> source, Func<T, bool> predicate)
{