MoreEnumerableToHashSetTSource(IEnumerableTSource, IEqualityComparerTSource) Method
Returns a
HashSetT of the source items using the specified equality
comparer for the type.
Namespace: MoreLinqAssembly: MoreLinq (in MoreLinq.dll) Version: 4.1.0+0e154ef592f33ce0f6f3d534a9eedee273f0ce72
public static HashSet<TSource> ToHashSet<TSource>(
IEnumerable<TSource> source,
IEqualityComparer<TSource>? comparer
)
Public Shared Function ToHashSet(Of TSource) (
source As IEnumerable(Of TSource),
comparer As IEqualityComparer(Of TSource)
) As HashSet(Of TSource)
public:
generic<typename TSource>
static HashSet<TSource>^ ToHashSet(
IEnumerable<TSource>^ source,
IEqualityComparer<TSource>^ comparer
)
static member ToHashSet :
source : IEnumerable<'TSource> *
comparer : IEqualityComparer<'TSource> -> HashSet<'TSource>
- source IEnumerableTSource
- Source sequence
- comparer IEqualityComparerTSource
- Equality comparer to use; a value of null will cause the type's default equality comparer to be used
- TSource
- Type of elements in source sequence.
HashSetTSourceA hash set of the items in the sequence, using the default equality comparer.
This evaluates the input sequence completely.