public ActionResult CreateBlogPost(CreateBlogPostModel blogPost) { if (ModelState.IsValid) { _commandDispatcher.Dispatch(new CreateBlogPostCommand(blogPost)); return RedirectToAction("Home", "Dashboard"); } return View(); }
public ActionResult CreateBlogPost() { var model = new CreateBlogPostModel { PublishedOn = DateTimeOffset.Now, ExistingCategories = GetExistingCategories() }; return View(model); }