public ActionResult Edit(EditFootballPredictionInputModel inputModel) { if (this.ModelState.IsValid) { var entity = this.Data.FootballPredictions.GetById(inputModel.Id); var entityForUpdate = Mapper.Map(inputModel, entity); this.Data.FootballPredictions.Update(entityForUpdate); this.Data.SaveChanges(); return(this.RedirectToAction("Index")); } return(this.View(inputModel)); }
public ActionResult Edit(EditFootballPredictionInputModel inputModel) { if (this.ModelState.IsValid) { var entity = this.Data.FootballPredictions.GetById(inputModel.Id); var entityForUpdate = Mapper.Map(inputModel, entity); this.Data.FootballPredictions.Update(entityForUpdate); this.Data.SaveChanges(); return this.RedirectToAction("Index"); } return this.View(inputModel); }