using System.Collections.Generic; using System.Linq; namespace Swan { /// /// This class contains extensions methods for IEnumerable /// public static class IEnumerableExtensions { /// /// This method make an union of two IEnumerables /// validation when some of them is null. /// /// T /// The this. /// The second. /// The Union public static IEnumerable UnionNull(this IEnumerable @this, IEnumerable second) { if (@this == null) return second; return second == null ? @this : @this.Union(second); } } }