Click or drag to resize
AlgorithmsGetSetEqualityComparerT Method (IEqualityComparerT)
Gets an IEqualityComparer<IEnumerable<T>> implementation that can be used to compare collections of elements (of type T). Two collections of T's are equal if they have the same number of items, and corresponding items are equal, without regard to order. This is the same notion of equality as in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static IEqualityComparer<IEnumerable<T>> GetSetEqualityComparer<T>(
	IEqualityComparer<T> equalityComparer
)

Parameters

equalityComparer
Type: System.Collections.GenericIEqualityComparerT
An IEqualityComparer<T> implementation used to compare individual T's.

Type Parameters

T

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

Return Value

Type: IEqualityComparerIEnumerableT
IEqualityComparer<IEnumerable<T>> implementation suitable for comparing collections of T for equality, without regard to order.
Examples
The following code creates a Dictionary where the keys are a set of strings, without regard to order
Dictionary<IEnumerable<string>, int> = 
    new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>());
See Also