PostSharp 6.10 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Collections Namespace / Extensions Class / Extensions Methods / Extensions.​To­Advisable­Hash­Set(T) Method

Extensions.ToAdvisableHashSet<T> Method

Converts an IEnumerable<T> into an AdvisableHashSet<T>.

Namespace:  PostSharp.Patterns.Collections
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: (
public static AdvisableHashSet<T> ToAdvisableHashSet<T>(
	this IEnumerable<T> collection


Type: System.Collections.Generic.IEnumerable<T>
An IEnumerable<T>, or null.

Type Parameters

Type of collection items.

Return Value

Type: AdvisableHashSet<T>
A new AdvisableHashSet<T> containing all elements of collection, or null if collection is empty.

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