Close this search box.

IsSubsetOf List extension

I’ve created  IsSubsetOf List extension based on discussion at

/// <summary>
  /// Determines whether a System.Collections.Generic.List<T> object is a subset of the specified collection.
 /// </summary>
  /// <param name="list"></param>
  /// <param name="listToFind"></param>
  /// <returns></returns>
  public static bool IsSubsetOf<T>(this List<T> coll1, List<T> coll2)
   bool isSubset = !coll1.Except(coll2).Any();
   return isSubset;
  • Share This Post:
  • Twitter
  • Facebook
  • Technorati   Short Url:
This article is part of the GWB Archives. Original Author: Michael Freidgeim’s Blog

Related Posts