public async Task <IActionResult> Edit(int id) { try { var patient = await _client.SendRequestAsync <Patient>(HttpMethod.Get, $"Patients/{id}"); if (patient == null) { return(NotFound()); } var model = PatientViewModel.GetModel(patient); return(View(model)); } catch (HttpRequestException) { throw new ServerConnectionException(); } }
public async Task <IActionResult> Details(int id) { if (TempData["message"] != null) { ModelState.AddModelError("info", _localizer[TempData["message"].ToString()]); } try { var patient = await _client.SendRequestAsync <Patient>(HttpMethod.Get, $"Patients/{id}"); if (patient == null) { return(NotFound()); } var model = PatientViewModel.GetModel(patient); return(View(model)); } catch (HttpRequestException) { throw new ServerConnectionException(); } }