Share via


Collection<T>.Convert<TDerived> Method

Creates a wrapper collection that can be used to access elements in the specified collection by using its base type.

Namespace:  Microsoft.SqlServer.Management.SqlParser.MetadataProvider
Assembly:  Microsoft.SqlServer.Management.SqlParser (in Microsoft.SqlServer.Management.SqlParser.dll)

Syntax

'Declaration
Public Shared Function Convert(Of TDerived As {Class, T}) ( _
    collection As IMetadataCollection(Of TDerived) _
) As IMetadataCollection(Of T)
'Usage
Dim collection As IMetadataCollection(Of TDerived)
Dim returnValue As IMetadataCollection(Of T)

returnValue = Collection.Convert(collection)
public static IMetadataCollection<T> Convert<TDerived>(
    IMetadataCollection<TDerived> collection
)
where TDerived : class, T
public:
generic<typename TDerived>
where TDerived : ref class, T
static IMetadataCollection<T>^ Convert(
    IMetadataCollection<TDerived>^ collection
)
static member Convert : 
        collection:IMetadataCollection<'TDerived> -> IMetadataCollection<'T>  when 'TDerived : not struct and 'T
JScript does not support generic types and methods.

Type Parameters

  • TDerived
    The type of the elements in the collection to be converted.

Parameters

Return Value

Type: Microsoft.SqlServer.Management.SqlParser.Metadata.IMetadataCollection<T>
The IMetadataCollection<T> object that contains the same elements as the specified collection.