Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.17 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public static class IEnumerableExtensions
  2. {
  3.   public static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> source)
  4.   {
  5.     return source ?? Enumerable.Empty<T>();
  6.   }
  7. }