 | ISphinxQLExecutorExecuteNonQueryAsync(String, CancellationToken, Object) Method |
Asynchronously executes a non-query command.
Namespace: SphinxConnector.FluentApiAssembly: SphinxConnector (in SphinxConnector.dll) Version: 6.0.0
SyntaxTask<int> ExecuteNonQueryAsync(
string commandText,
CancellationToken cancellationToken,
Object parameters = null
)
Function ExecuteNonQueryAsync (
commandText As String,
cancellationToken As CancellationToken,
Optional parameters As Object = Nothing
) As Task(Of Integer)
Parameters
- commandText String
- The command to execute.
- cancellationToken CancellationToken
- The token to monitor for cancellation requests.
- parameters Object (Optional)
- Optional parameters for the command.
Return Value
TaskInt32The number of rows affected by the statement.
Example
using (IFulltextSession fulltextSession = fulltextStore.StartSession())
{
ISphinxQLExecutor sphinxQLExecutor = fulltextSession.Advanced.CreateSphinxQLExecutor();
CancellationTokenSource cts = new CancellationTokenSource();
int rowsAffected = await sphinxQLExecutor.ExecuteNonQueryAsync("DELETE FROM index WHERE id IN @ids", cts.Token, new { ids = new [] { 1, 2, 3 } });
}
See Also