public ActionResult Edit(TemperatureViewModel model) { try { bool result = _TemperatureService.UpdateTemperature(model); if (result) { Alert("Congratulations", "Temperature successfully updated!", NotificationType.success); } else { Alert("Error", "Temperature Failed to be updated!", NotificationType.error); } return(View(nameof(Index))); throw new Exception(); } catch { return(View()); } }