Пример #1
0
        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);
        }
Пример #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);
        }