public void Handle(AddCommentToPost addCommentToPost) { var post = _repository.Get(addCommentToPost.Id); post.AddComment( addCommentToPost.Author, addCommentToPost.EMail, addCommentToPost.Url, addCommentToPost.Comment, addCommentToPost.Occured); }
public ActionResult AddComment(AddCommentToPost addComment) { var post = _posts.Get(addComment.Id); if (ModelState.IsValid) { var saga = GetOrCreateSagaOfComments(post); _sagaNarrator.TransitionTo<Comments>(saga); addComment.Occured = DateTime.Now; _commandCoordinator.Handle(saga, addComment); } return View("Show", GetPostViewModelFromPost(post)); }