Click or drag to resize
DataExtensions.ToHashSet<T> Method (IEnumerable<T>, IEqualityComparer<T>)
Converts the list of objects to a hash set of distinct values

Namespace: CMS.DataEngine
Assembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 9.0.0
Syntax
C#
public static HashSet<T> ToHashSet<T>(
	this IEnumerable<T> objects,
	IEqualityComparer<T> comparer = null
)

Parameters

objects
Type: System.Collections.Generic.IEnumerable<T>
List of objects to convert
comparer (Optional)
Type: System.Collections.Generic.IEqualityComparer<T>
Comparer

Type Parameters

T

Return Value

Type: HashSet<T>

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<T>. 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