Share via


Metodo DbRawSqlQuery<TElement>.ToListAsync (CancellationToken)

[Questa pagina è specifica della versione 6 di Entity Framework. La versione più recente è disponibile come pacchetto NuGet per "Entity Framework". Per ulteriori informazioni su Entity Framework, vedere la pagina msdn.com/data/ef.]

Crea un oggetto List<T> dalla query enumerandolo in modo asincrono.

Spazio dei nomi:  System.Data.Entity.Infrastructure
Assembly:  EntityFramework (in EntityFramework.dll)

Sintassi

'Dichiarazione
<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")> _
Public Function ToListAsync ( _
    cancellationToken As CancellationToken _
) As Task(Of List(Of TElement))
'Utilizzo
Dim instance As DbRawSqlQuery 
Dim cancellationToken As CancellationToken 
Dim returnValue As Task(Of List(Of TElement))

returnValue = instance.ToListAsync(cancellationToken)
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public Task<List<TElement>> ToListAsync(
    CancellationToken cancellationToken
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1006:DoNotNestGenericTypesInMemberSignatures")]
public:
Task<List<TElement>^>^ ToListAsync(
    CancellationToken cancellationToken
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")>]
member ToListAsync : 
        cancellationToken:CancellationToken -> Task<List<'TElement>> 
public function ToListAsync(
    cancellationToken : CancellationToken
) : Task<List<TElement>>

Parametri

Valore restituito

Tipo: System.Threading.Tasks.Task<List<TElement>>
Attività che rappresenta l'operazione asincrona.Il risultato dell'attività contiene un oggetto List<T> che contiene elementi della sequenza di input.

Note

Non è consentito eseguire più operazioni attive nella stessa istanza di contesto. Utilizzare 'await' per assicurarsi che eventuali operazioni asincrone vengano completate prima di chiamare un altro metodo su questo contesto.

Vedere anche

Riferimento

DbRawSqlQuery<TElement> Classe

Overload ToListAsync

Spazio dei nomi System.Data.Entity.Infrastructure