public ActionResult Create(CreateIdeaViewModel model) { if (!this.ModelState.IsValid) { this.View(model); } if (this.User.Identity.IsAuthenticated) { this.ideas.Add(model.Title, model.Description, this.Request.UserHostAddress, this.User.Identity.GetUserId()); } else { this.ideas.Add(model.Title, model.Description, this.Request.UserHostAddress, null); } this.TempData["notification"] = "Idea created"; return this.RedirectToAction("Index"); }
public ActionResult Create(CreateIdeaViewModel model) { if (!this.ModelState.IsValid) { this.View(model); } if (this.User.Identity.IsAuthenticated) { this.ideas.Add(model.Title, model.Description, this.Request.UserHostAddress, this.User.Identity.GetUserId()); } else { this.ideas.Add(model.Title, model.Description, this.Request.UserHostAddress, null); } this.TempData["notification"] = "Idea created"; return(this.RedirectToAction("Index")); }