static void Main(string[] args)
        {
            var postQueryRepository = new PostQueryRepository();
            var posts = postQueryRepository.GetAll();

            Write.Posts(posts);

            BeginQuestions();
        }
        public void ExecuteAction()
        {
            var title = Ask.PostTitle();
            var text  = Ask.PostText();

            _postCommandHandler.Handle(new AddPost {
                Title = title, Text = text
            });

            var posts = _postQueryRepository.GetAll();

            Write.Posts(posts);
        }
Beispiel #3
0
        public void ExecuteAction()
        {
            var id = Ask.PostId();

            _commentCommandHandler.Handle(new DeletePostComments {
                PostId = id
            });
            _postCommandHandler.Handle(new DeletePost {
                Id = id
            });

            var posts = _postQueryRepository.GetAll();

            Write.Posts(posts);
        }