Click or drag to resize
DataExtensionsToHashSetT, TSource Method (IEnumerableTSource, FuncTSource, T, IEqualityComparerT)
Converts the list of objects to a hash set of distinct values

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

Parameters

objects
Type: System.Collections.GenericIEnumerableTSource
List of objects to convert
transform
Type: SystemFuncTSource, T
Function to transform the object to hash set item. When returns null, the object is not added to the result
comparer (Optional)
Type: System.Collections.GenericIEqualityComparerT
Comparer

Type Parameters

T
TSource

Return Value

Type: HashSetT

Usage Note

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