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