You can emulate this through .Intersect()and check if the intersection set has all the necessary elements. I think this is pretty inefficient, but quick and dirty.
List<T> list = ...
List<T> shouldBeContained = ...
bool containsAll = (list.Intersect(shouldBeContained).Count == shouldBeContained.Count)
Or you can do it with .All (). I think this is more efficient and cleaner:
List<T> list = ...
List<T> shouldBeContained = ...
bool containsAll = (shouldBeContained.All(x=>list.Contains(x));
source
share