Skip to content

Instantly share code, notes, and snippets.

@sclarson
sclarson / ExtMethod.cs
Created August 2, 2011 18:41 — forked from cammerman/ExtMethod.cs
IEnumerable Null Check
public static class IEnumerableExtensions
{
public static IEnumerable<T> OrEmptyListIfNull<T>(this IEnumerable<T> source)
{
return source ?? Enumerable.Empty<T>();
}
}