EnumerableExtensions.ToReadOnlyCollection<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.