CollectionUtilities..::..AsReadOnlyCollection<(Of <(<'T>)>)> Method

Casts an IList<T> into a AsReadOnlyCollection<T>. If the cast fails, the list is wrapped in an adapter.

Namespace:  Tortuga.Anchor
Assembly:  Tortuga.Anchor (in Tortuga.Anchor.dll)

Syntax


public static Nullable<IReadOnlyCollection<T>> AsReadOnlyCollection<T>(
	Nullable<IEnumerable<T>> source
)
Public Shared Function AsReadOnlyCollection(Of T) ( _
	source As Nullable(Of IEnumerable(Of T)) _
) As Nullable(Of IReadOnlyCollection(Of T))

Type Parameters

T

Parameters

source
Type: Nullable<(Of <(<'IEnumerable<(Of <(<'T>)>)>>)>)>
The source. If the source is null, the result will be null.

Return Value

IReadOnlyList<T>.

Remarks


This is meant to be used for legacy codebases that predate IReadOnlyCollection<T>.