Skip to content

Instantly share code, notes, and snippets.

@bentayloruk
Created March 31, 2011 15:16
Show Gist options
  • Save bentayloruk/896545 to your computer and use it in GitHub Desktop.
Save bentayloruk/896545 to your computer and use it in GitHub Desktop.
Promise a non-null IEnumerable in your method chains. Simplicity.
public static IEnumerable<T> Promise<T>(this IEnumerable<T> enumerable)
{
return enumerable ?? Enumerable.Empty<T>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment