CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of extension-method
C#
/// <summary>
/// Return empty enumerator when passed enumerator equals to null
/// </summary>
/// <param name="source">The source.</param>
/// <returns></returns>
public static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> source) 
{
    return source ?? Enumerable.Empty<T>();
}
by tarasn   January 19, 2010 @ 11:21pm
182 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate