IEnumerableExtensionMethodsToHashSetTDestination Method |
Creates a new hashset and adds the source to it.
Namespace:
SD.Tools.BCLExtensions.CollectionsRelated
Assembly:
SD.Tools.BCLExtensions (in SD.Tools.BCLExtensions.dll) Version: 1.0.0.0 (1.0.10.1127)
Syntax public static HashSet<TDestination> ToHashSet<TDestination>(
this IEnumerable<TDestination> source
)
<ExtensionAttribute>
Public Shared Function ToHashSet(Of TDestination) (
source As IEnumerable(Of TDestination)
) As HashSet(Of TDestination)
Parameters
- source
- Type: System.Collections.GenericIEnumerableTDestination
The source.
Type Parameters
- TDestination
- The type of the destination.
Return Value
Type:
HashSetTDestinationHashset with all the unique values in source
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableTDestination. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also