public ActionResult RegisterPatientForm(string UserId) { var patient = new PatientFormViewModels(); if (UserId != null) { var model = _context.PacientRepository.GetBy(x => x.UserId == UserId); patient = Mapper.Map <Patient, PatientFormViewModels>(model); patient.Image1 = model.Image; patient.SelectedGender = model.Gender; } patient.Genders = _userBll.GetGenderTypes(); return(View("RegisterPatientForm", patient)); }