DbRawSqlQuery<TElement>.AllAsync-Methode (Func<TElement, Boolean>, CancellationToken)
[Diese Seite bezieht sich auf Entity Framework Version 6. Die neueste Version ist als 'Entity Framework' NuGet-Paket verfügbar. Weitere Informationen zu Entity Framework finden Sie unter msdn.com/data/ef.]
Bestimmt asynchron, ob alle Elemente der Abfrage eine Bedingung erfüllen.
Namespace: System.Data.Entity.Infrastructure
Assembly: EntityFramework (in EntityFramework.dll)
Syntax
'Declaration
Public Function AllAsync ( _
predicate As Func(Of TElement, Boolean), _
cancellationToken As CancellationToken _
) As Task(Of Boolean)
'Usage
Dim instance As DbRawSqlQuery
Dim predicate As Func(Of TElement, Boolean)
Dim cancellationToken As CancellationToken
Dim returnValue As Task(Of Boolean)
returnValue = instance.AllAsync(predicate, _
cancellationToken)
public Task<bool> AllAsync(
Func<TElement, bool> predicate,
CancellationToken cancellationToken
)
public:
Task<bool>^ AllAsync(
Func<TElement, bool>^ predicate,
CancellationToken cancellationToken
)
member AllAsync :
predicate:Func<'TElement, bool> *
cancellationToken:CancellationToken -> Task<bool>
public function AllAsync(
predicate : Func<TElement, boolean>,
cancellationToken : CancellationToken
) : Task<boolean>
Parameter
- predicate
Typ: System.Func<TElement, Boolean>
Eine Funktion, mit der jedes Element auf eine Bedingung überprüft wird.
- cancellationToken
Typ: System.Threading.CancellationToken
Ein CancellationToken, das beim Warten auf den Abschluss der Aufgabe überwacht werden soll.
Rückgabewert
Typ: System.Threading.Tasks.Task<Boolean>
Eine Aufgabe, die den asynchronen Vorgang darstellt.Das Aufgabeergebnis enthält true, wenn jedes Element des Abfrageergebnisses den Test im angegebenen Prädikat besteht. Andernfalls enthält das Aufgabeergebnis false.
Ausnahmen
Ausnahme | Bedingung |
---|---|
ArgumentNullException | predicate ist null. |
Hinweise
Mehrere aktive Vorgänge für dieselbe Kontextinstanz werden nicht unterstützt. Verwenden Sie await, um sicherzustellen, dass sämtliche asynchronen Vorgänge abgeschlossen sind, bevor eine andere Methode in diesem Kontext aufgerufen wird.