public ActionResult Update(UpdatePostCommand command) { return ValidateAndSendCommand(command, () => RedirectToAction("Show", "Post", new { slug = command.Slug }), () => { throw new ApplicationException("Failed to update post"); }); }
private UpdatePostCommand CreateUpdatePostCommand(PostItem postItem) { var updatePostCommand = new UpdatePostCommand(postItem.Title, postItem.Content, postItem.Slug, postItem.Tags, postItem.Excerpt, postItem.AggregateId); return updatePostCommand; }