public void ExecuteAction() { var id = Ask.PostId(); var post = _postRepository.GetById(id); var comments = _commentRepository.GetAll(id); Write.Post(post, comments); }
public void ExecuteAction() { var id = Ask.PostId(); var title = Ask.PostTitle(); var text = Ask.PostText(); _postCommandHandler.Handle(new UpdatePost { Id = id, Title = title, Text = text }); var post = _postQueryRepository.GetById(id); IEnumerable <Comment> comments = null; if (post != null) { comments = _commentQueryRepository.GetAll(post.Id); } Write.Post(post, comments); }