Click or drag to resize

ISphinxQLExecutorExecuteNonQueryAsync Method (String, CancellationToken, Object)

Asynchronously executes a non-query command.

Namespace:  SphinxConnector.FluentApi
Assembly:  SphinxConnector (in SphinxConnector.dll) Version: 5.3.0
Syntax
Task<int> ExecuteNonQueryAsync(
	string commandText,
	CancellationToken cancellationToken,
	Object parameters = null
)

Parameters

commandText
Type: SystemString
The command to execute.
cancellationToken
Type: System.ThreadingCancellationToken
The token to monitor for cancellation requests.
parameters (Optional)
Type: SystemObject
Optional parameters for the command.

Return Value

Type: TaskInt32
The number of rows affected by the statement.
Examples
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