public async Task SendAsync(IAdminOperation operation, CancellationToken token = default(CancellationToken)) { JsonOperationContext context; using (RequestExecutor.ContextPool.AllocateOperationContext(out context)) { var command = operation.GetCommand(_requestExecutor.Conventions, context); await RequestExecutor.ExecuteAsync(command, context, token).ConfigureAwait(false); } }
public async Task <Operation> SendAsync(IAdminOperation <OperationIdResult> operation, CancellationToken token = default(CancellationToken)) { JsonOperationContext context; using (RequestExecutor.ContextPool.AllocateOperationContext(out context)) { var command = operation.GetCommand(_requestExecutor.Conventions, context); await _requestExecutor.ExecuteAsync(command, context, token).ConfigureAwait(false); return(new Operation(_requestExecutor, () => _store.Changes(_databaseName), _requestExecutor.Conventions, command.Result.OperationId)); } }