public async Task <IActionResult> Post([FromBody] TemperatureAddDto temperature) { try { var id = await _temperatureService.AddAsync(temperature); var saveResult = await _temperatureService.SaveAsync(); if (saveResult == 0) { _logger.LogError("Unable to add a new temperature at this time"); return(StatusCode(StatusCodes.Status500InternalServerError)); } return(Ok(id)); } catch (Exception exception) { _logger.LogError(exception, "An error occurred while trying to add a new temperature"); return(StatusCode(StatusCodes.Status500InternalServerError)); } }