Share via


ReadOnlyList<T> Structure

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

Namespace:  Microsoft.SqlServer.Management.Sdk.Sfc
Assembly:  Microsoft.SqlServer.Management.Sdk.Sfc (in Microsoft.SqlServer.Management.Sdk.Sfc.dll)

Syntax

'Declaration
Public Structure ReadOnlyList(Of T) _
    Implements IReadOnlyList(Of T), IReadOnlyCollection(Of T),  _
    IReadOnlyCollection, IEnumerable(Of T), IEnumerable
'Usage
Dim instance As ReadOnlyList(Of T)
public struct ReadOnlyList<T> : IReadOnlyList<T>, 
    IReadOnlyCollection<T>, IReadOnlyCollection, IEnumerable<T>, IEnumerable
generic<typename T>
public value class ReadOnlyList : IReadOnlyList<T>, 
    IReadOnlyCollection<T>, IReadOnlyCollection, IEnumerable<T>, IEnumerable
[<SealedAttribute>]
type ReadOnlyList<'T> =  
    struct 
        interface IReadOnlyList<'T>
        interface IReadOnlyCollection<'T>
        interface IReadOnlyCollection 
        interface IEnumerable<'T>
        interface IEnumerable 
    end
JScript does not support generic types and methods.

Type Parameters

  • T
    The type of elements in the list.

The ReadOnlyList<T> type exposes the following members.

Constructors

  Name Description
Public method ReadOnlyList<T> Initializes a new instance of the ReadOnlyList<T> class with the specified list.

Top

Properties

  Name Description
Public property Count Gets the number of elements contained in the list.
Public property Item Gets the element at the specified index.

Top

Methods

  Name Description
Public method Contains Indicates whether the list contains a specific value.
Public method CopyTo Copies the elements of the list to an array, starting at a particular array index.
Public method Equals (Inherited from ValueType.)
Public method GetEnumerator Returns an enumerator that iterates through the list.
Public method GetHashCode (Inherited from ValueType.)
Public method GetType (Inherited from Object.)
Public method IndexOf Determines the index of a specific item in the list.
Public method ToString (Inherited from ValueType.)

Top

Operators

  Name Description
Public operatorStatic member Implicit(List<T> to ReadOnlyList<T>) Returns an implicit conversion from a list to a read only list.
Public operatorStatic member Implicit(array<T[] to ReadOnlyList<T>) Returns an implicit conversion from an array to a list.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IEnumerable.GetEnumerator Returns an enumerator that iterates through the list.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.SqlServer.Management.Sdk.Sfc Namespace