public static Task ExecuteAsync(this IDbCommandAsyncExecutor executor, ExecuteNonReaderRequest request, Func <DbCommand, Task> execute) { var requests = new[] { new ExecuteCommandAsyncRequest(request.CreateCommandRequest, execute) }; return(executor.ExecuteAsync(requests, request.CancellationToken)); }
public static async Task <object> ExecuteScalarAsync(this IDbCommandAsyncExecutor executor, ExecuteNonReaderRequest request) { object scalar = null; await executor.ExecuteAsync( request, async command => scalar = await command.ExecuteScalarAsync(request.CancellationToken)); return(scalar); }
public static async Task <int> ExecuteNonQueryAsync(this IDbCommandAsyncExecutor executor, ExecuteNonReaderRequest request) { var affectedRows = 0; await executor.ExecuteAsync( request, async command => affectedRows = await command.ExecuteNonQueryAsync(request.CancellationToken)); return(affectedRows); }