Share via


ReadOnlyList<T> Struct

Definition

A generic struct that exposes the read-only interface of a list while hides its mutable interface.

public struct ReadOnlyList<T> : Microsoft.SqlServer.Management.Sdk.Sfc.IReadOnlyCollection<T>, Microsoft.SqlServer.Management.Sdk.Sfc.IReadOnlyList<T>, System.Collections.Generic.IEnumerable<T>
type ReadOnlyList<'T> = struct
    interface seq<'T>
    interface IEnumerable
    interface IReadOnlyList<'T>
    interface IReadOnlyCollection<'T>
    interface IReadOnlyCollection
Public Structure ReadOnlyList(Of T)
Implements IEnumerable(Of T), IReadOnlyCollection(Of T), IReadOnlyList(Of T)

Type Parameters

T

The type of elements in the list.

Inheritance
ReadOnlyList<T>
Implements

Constructors

ReadOnlyList<T>(IList<T>)

Initializes a new instance of ReadOnlyList<T> that wraps the specified IList<T> in a read-only interface.

Properties

Count

Gets the number of elements contained in the ReadOnlyList<T>.

Item[Int32]

Gets the element at the specified index.

Methods

Contains(T)

Determines whether the ReadOnlyList<T> contains a specific value.

CopyTo(T[], Int32)

Copies the elements of the ReadOnlyList<T> to an Array, starting at a particular Array index.

GetEnumerator()

Returns an enumerator that iterates through the list.

IndexOf(T)

Determines the index of a specific item in the ReadOnlyList<T>.

Operators

Implicit(List<T> to ReadOnlyList<T>)
Implicit(T[] to ReadOnlyList<T>)

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through the list.

Applies to