public async Task <IActionResult> PutVegaTempDeviceData(long id, VegaMoveDeviceData tempDeviceData) { if (tempDeviceData is null) { return(BadRequest()); } if (id != tempDeviceData.Id || !_repository.DeviceExists(tempDeviceData.DeviceId)) { return(BadRequest()); } try { await _repository.EditVegaDeviceDataAsync(tempDeviceData).ConfigureAwait(false); } catch (DbUpdateConcurrencyException) { if (!_repository.MoveDeviceDataExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }