Returns a HashSet<(Of <(<'T>)>)> of the source items using the default equality
comparer for the type.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public static HashSet<TSource> ToHashSet<TSource>( this IEnumerable<TSource> source )
<ExtensionAttribute> _ Public Shared Function ToHashSet(Of TSource) ( _ source As IEnumerable(Of TSource) _ ) As HashSet(Of TSource)
public: [ExtensionAttribute] generic<typename TSource> static HashSet<TSource>^ ToHashSet( IEnumerable<TSource>^ source )
Generic Template Parameters
- TSource
[Missing <typeparam name="TSource"/> documentation for "M:MoreLinq.MoreEnumerable.ToHashSet``1(System.Collections.Generic.IEnumerable{``0})"]
Parameters
- source (IEnumerable<(Of <(<'TSource>)>)>)
- Source sequence
Return Value
A hash set of the items in the sequence, using the default equality comparer.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<(Of <(<'TSource>)>)>. When you use instance method syntax to call this method, omit the first parameter.
Remarks
This evaluates the input sequence completely.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | source is null |
Assembly: MoreLinq (Module: MoreLinq.dll) Version: 1.0.16006.0 (1.0.16006.1845)