public ActionResult Add(Athlete athlete) { ViewBag.teamsList = ItemListCreator.Teams(_teamRepo); ViewBag.sportsList = ItemListCreator.Sports(); if (ModelState.IsValid) { if (_athRepo.Add(athlete)) { ViewBag.Success = "Added succesfully"; return(View()); } } ViewBag.Error = "Error adding an athlete!"; return(View()); }
public Athlete Add(Athlete entity) { var obj = _athleteRepository.Add(entity); return(obj); }