Created
August 20, 2013 17:15
-
-
Save jamesrcounts/6284365 to your computer and use it in GitHub Desktop.
Don't get bit by null collections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<TMembers> EmptyIfNull<TMembers>(this IEnumerable<TMembers> source) | |
{ | |
return source ?? Enumerable.Empty<TMembers>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment