public ActionResult Post([FromBody] InputParametersBase input) { if (input.ClientId == Guid.Empty) { return(BadRequest("Client not found")); } return(Ok(_restoreService.RestoreAsync(input.ClientId, input.BackupId))); }
public Task<RestoreStatus> Post(Guid connectionId, [FromBody]int backupId) { var client = _authService.GetCurrentClient(this.User); if(client == null) { BadRequest(); } return _restoreService.RestoreAsync(connectionId, new RestoreParamsDTO { BackupId = backupId, ClientId = client.ClientId}); }
public async Task <RestoreResult> ImportAsync(BackupConverter converter, byte[] data, string password) { if (converter == null) { throw new ArgumentNullException(nameof(converter)); } if (data == null) { throw new ArgumentNullException(nameof(data)); } var backup = await converter.ConvertAsync(data, password); return(await _restoreService.RestoreAsync(backup)); }
public async Task RestoreAsyncTest() { await _restoreService.RestoreAsync(_backup); await AssertDatabaseMatchesBackupAsync(); }