public ActionResult Create(AddFeedBackViewModel model) { if (ModelState.IsValid) { Feedback fb = new Feedback(); Mapper.Map(model, fb); fb.Author = this.UserProfile; this.Data.Feedbacks.Add(fb); this.Data.SaveChanges(); this.TempData["Notification"] = "Feedback successfully sent"; return(this.Redirect("/")); } return(this.View(model)); }
public ActionResult Create(AddFeedBackViewModel model) { if (ModelState.IsValid) { Feedback fb = new Feedback(); Mapper.Map(model, fb); fb.Author = this.UserProfile; this.Data.Feedbacks.Add(fb); this.Data.SaveChanges(); this.TempData["Notification"] = "Feedback successfully sent"; return this.Redirect("/"); } return this.View(model); }