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));
            }
        }
 public Operation Send(IAdminOperation <OperationIdResult> operation)
 {
     return(AsyncHelpers.RunSync(() => SendAsync(operation)));
 }
 public TResult Send <TResult>(IAdminOperation <TResult> operation)
 {
     return(AsyncHelpers.RunSync(() => SendAsync(operation)));
 }
 public void Send(IAdminOperation operation)
 {
     AsyncHelpers.RunSync(() => SendAsync(operation));
 }