Click or drag to resize
AlgorithmsIsSubsetOfT Method (IEnumerableT, IEnumerableT, IEqualityComparerT)
Determines if one collection is a subset of another, considered as sets. The first set is a subset of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, it must appear at least X times in the second set.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static bool IsSubsetOf<T>(
	IEnumerable<T> collection1,
	IEnumerable<T> collection2,
	IEqualityComparer<T> equalityComparer
)

Parameters

collection1
Type: System.Collections.GenericIEnumerableT
The first collection.
collection2
Type: System.Collections.GenericIEnumerableT
The second collection.
equalityComparer
Type: System.Collections.GenericIEqualityComparerT
The IEqualityComparer<T> used to compare items for equality.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.IsSubsetOf``1(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEqualityComparer{``0})"]

Return Value

Type: Boolean
True if collection1 is a subset of collection2, considered as sets.
Exceptions
ExceptionCondition
ArgumentNullExceptioncollection1 or collection2 is null.
Remarks

If both collections are Set, Bag, OrderedSet, or OrderedBag collections, it is more efficient to use the IsSubsetOf method on that class.

See Also