ImmutableArray<T>.As<TOther> Metod

Definition

Returnerar en ny oföränderlig matris som innehåller elementen i den här matrisen till en annan typ.

public:
generic <typename TOther>
 where TOther : class System::Collections::Immutable::ImmutableArray<TOther> As();
public System.Collections.Immutable.ImmutableArray<TOther> As<TOther>() where TOther : class;
member this.As : unit -> System.Collections.Immutable.ImmutableArray<'Other (requires 'Other : null)> (requires 'Other : null)
Public Function As(Of TOther As Class) () As ImmutableArray(Of TOther)

Typparametrar

TOther

Vilken typ av matriselement som ska returneras.

Returer

ImmutableArray<TOther>

En oföränderlig matris som innehåller elementen i den här matrisen, gjuten till en annan typ. Om gjutningen misslyckas returnerar en matris vars IsDefault egenskap returnerar true.

Kommentarer

Matriser med härledda elementtyper kan omvandlas till matriser med baselementtyper utan att matrisen omplaceras.

Uppsändningar av element som skapats med Create metoden kan ångras med hjälp av As -metoden. Ett nedkastat resultat lyckas dock bara när en tidigare uppsändning återställs. åtgärd.

Gäller för