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"))); }
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"))); } }
public Task StartRestoreAsync(RestoreRequest restoreRequest) { var request = adminRequest.CreateRestoreRequest(); return(request.WriteAsync(RavenJObject.FromObject(restoreRequest))); }