public ActionResult Create(BaseFootballPredictionInputModel inputModel) { if (this.ModelState.IsValid) { var entity = Mapper.Map <FootballPrediction>(inputModel); this.Data.FootballPredictions.Add(entity); this.Data.SaveChanges(); BackgroundJob.Enqueue(() => SendEmail()); return(this.RedirectToAction("Index")); } return(this.View(inputModel)); }
public ActionResult Create(BaseFootballPredictionInputModel inputModel) { if (this.ModelState.IsValid) { var entity = Mapper.Map<FootballPrediction>(inputModel); this.Data.FootballPredictions.Add(entity); this.Data.SaveChanges(); BackgroundJob.Enqueue(() => SendEmail()); return this.RedirectToAction("Index"); } return this.View(inputModel); }