public IActionResult Profile(string id) { EquipmentAssignment pUser = lIAssignmentInterface.getEquipmentAssignment(id); List <SelectListItem> myList = new List <SelectListItem>() { new SelectListItem { Value = "1", Text = "Ankle Unit" }, new SelectListItem { Value = "2", Text = "Knee Unit" }, new SelectListItem { Value = "3", Text = "Elbow Unit" }, new SelectListItem { Value = "4", Text = "Shoulder Unit" }, }; ViewBag.equipment = myList; List <User> _userPatientlist = lIUserRepository.getUserListByType(1); var ObjList = _userPatientlist.Select(r => new SelectListItem { Value = r.UserId.ToString(), Text = r.Name }); ViewBag.Patient = new SelectList(ObjList, "Value", "Text"); ViewBag.Patient = ObjList; List <User> _userTherapistlist = lIUserRepository.getUserListByType(2); var ObjTherapistList = _userTherapistlist.Select(r => new SelectListItem { Value = r.UserId.ToString(), Text = r.Name }); ViewBag.Therapists = new SelectList(ObjList, "Value", "Text"); ViewBag.Therapists = ObjTherapistList; EquipmentView pequipment = UserExtension.EquipmentToEquipmentAssignmentExtension(pUser); return(View(pequipment)); }