예제 #1
0
		public ActionResult CreateBlogPost(CreateBlogPostModel blogPost)
		{
			if (ModelState.IsValid)
			{
				_commandDispatcher.Dispatch(new CreateBlogPostCommand(blogPost));
				return RedirectToAction("Home", "Dashboard");
			}

			return View();
		}
예제 #2
0
		public ActionResult CreateBlogPost()
		{
			var model = new CreateBlogPostModel
			{
				PublishedOn = DateTimeOffset.Now,
				ExistingCategories = GetExistingCategories()
			};

			return View(model);
		}