public ActionResult Edit(int id, ModelViewMatch match) { if (ModelState.IsValid) { try { var updateMatch = Mapper.Map <ModelViewMatch, Match>(match); _repo.Update(updateMatch); return(RedirectToAction("Index")); } catch { return(View(match)); } } return(View(match)); }
public ActionResult Create(ModelViewMatch match) { if (ModelState.IsValid) { try { var newMatch = Mapper.Map <ModelViewMatch, Match>(match); _repo.Add(newMatch); return(RedirectToAction("Index")); } catch { return(View(match)); } } return(View(match)); }