public async Task SaveChangedPatientInfo(string name, ChangePatientInfoViewModel changePatientInfoViewModel, CancellationToken cancellationToken) { var patient = await _patientsRepository.GetAsync(name, cancellationToken).ConfigureAwait(false); patient.LastName = changePatientInfoViewModel.LastName; patient.Phone = changePatientInfoViewModel.Phone; await _patientsRepository.Update(patient, cancellationToken).ConfigureAwait(false); }
public async Task <IActionResult> SubmitChangedInfo(ChangePatientInfoViewModel changePatientInfoViewModel, CancellationToken cancellationToken) { await _appService.SaveChangedPatientInfo(User.Identity.Name, changePatientInfoViewModel, cancellationToken); return(RedirectToAction("Index", "Home")); }