Language
Edit

EnumerableExtensions.ToReadOnlyCollection<T> Method

Definition

Creates a read-only copy of an existing collection.

public static System.Collections.ObjectModel.ReadOnlyCollection<T> ToReadOnlyCollection<T>(this System.Collections.Generic.IEnumerable<T> items);
static member ToReadOnlyCollection : seq<'T> -> System.Collections.ObjectModel.ReadOnlyCollection<'T>
<Extension()>
Public Function ToReadOnlyCollection(Of T) (items As IEnumerable(Of T)) As ReadOnlyCollection(Of T)

Type Parameters

T

The type of items in the collection.

Parameters

items
IEnumerable<T>

The collection to be copied.

Returns

The new, read-only copy of items.

Applies to