public IActionResult Edit(int id) { List <Gender> genders = _genderRepo.GetAllGenders().ToList(); ViewBag.Genders = new SelectList(genders.ToList(), "GenderId", "Sex");//for gender Dropdown Student student = _repo.GetStudentById(id); if (student == null) { return(NotFound()); } return(View(student)); }
public ActionResult <IEnumerable <GenderReadDto> > GetAllGenders() { var genderItems = _repository.GetAllGenders(); return(Ok(_mapper.Map <IEnumerable <GenderReadDto> >(genderItems))); }