예제 #1
0
        public async Task <Operation> StartRestoreAsync(DatabaseRestoreRequest restoreRequest)
        {
            var request = adminRequest.CreateRestoreRequest();

            await request.WriteAsync(RavenJObject.FromObject(restoreRequest));

            var jsonResponse = await request.ReadResponseJsonAsync().ConfigureAwait(false);

            return(new Operation(innerAsyncServerClient, jsonResponse.Value <long>("OperationId")));
        }
예제 #2
0
        public async Task <Operation> StartRestoreAsync(DatabaseRestoreRequest restoreRequest, CancellationToken token = default(CancellationToken))
        {
            using (var request = adminRequest.CreateRestoreRequest())
            {
                await request.WriteAsync(RavenJObject.FromObject(restoreRequest)).WithCancellation(token);

                var jsonResponse = await request.ReadResponseJsonAsync().WithCancellation(token).ConfigureAwait(false);

                return(new Operation((AsyncServerClient)innerAsyncServerClient.ForSystemDatabase(), jsonResponse.Value <long>("OperationId")));
            }
        }
예제 #3
0
        public Task StartRestoreAsync(RestoreRequest restoreRequest)
        {
            var request = adminRequest.CreateRestoreRequest();

            return(request.WriteAsync(RavenJObject.FromObject(restoreRequest)));
        }