public ActionResult Ask(AskInputModel input) { if (ModelState.IsValid) { var post = (new Post { Title = input.Title, Content = this.sanitizer.Sanitize(input.Content) // TODO: Tags // TODO: Author }); this.posts.Add(post); this.posts.SaveChanges(); return this.RedirectToAction("Display", new { id = post.Id, url = "new" }); } return this.View(input); }
public ActionResult Ask() { var model = new AskInputModel(); return this.View(model); }