public async Task <IActionResult> UpdateDevice([FromQuery] string Id, [FromBody] DeviceRequestUpdate Request) { try { var guid = Guid.Parse(Id); if (guid.ToString() != Id) { return(BadRequest("The device Id specified in the body is different from the one specified in the URL.")); } var result = await _dataProvider.DeviceUpdate(Request.ToDevice()); return(Ok(result)); } catch (FormatException) { return(BadRequest("Please specify a valid guid for the device.")); } catch (EntityNotFoundException exc) { return(NotFound(exc.Message)); } catch (Exception) { throw; } }