ImmutableHashSet::ToImmutableHashSet<TSource> Method (IEnumerable<TSource>^, IEqualityComparer<TSource>^)
Enumerates a sequence, produces an immutable hash set of its contents, and uses the specified equality comparer for the set type.
Assembly: System.Collections.Immutable (in System.Collections.Immutable.dll)
public: generic<typename TSource> [ExtensionAttribute] static ImmutableHashSet<TSource>^ ToImmutableHashSet( IEnumerable<TSource>^ source, IEqualityComparer<TSource>^ equalityComparer )
Parameters
- source
-
Type:
System.Collections.Generic::IEnumerable<TSource>^
The sequence to enumerate.
- equalityComparer
-
Type:
System.Collections.Generic::IEqualityComparer<TSource>^
The object to use for comparing objects in the set for equality.
Return Value
Type: System.Collections.Immutable::ImmutableHashSet<TSource>^An immutable hash set that contains the items in the specified sequence and uses the specified equality comparer.
Type Parameters
- TSource
The type of the elements in the sequence.
Show: