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

Extensions.ToAdvisableCollection<T> Method

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

Namespace:  PostSharp.Patterns.Collections
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 2023.0.3.0 (2023.0.3.0)
public static AdvisableCollection<T> ToAdvisableCollection<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: AdvisableCollection<T>
A new AdvisableCollection<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