Skip to content

Instantly share code, notes, and snippets.

View sclarson's full-sized avatar

Seth Larson sclarson

View GitHub Profile
@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>();
}
}