public HttpResponseMessage DeletePost(Post post)
        {
            var postExist = _postReadQueries.GetById(post.Id);

            if (postExist == null)
            {
                return new HttpResponseMessage(HttpStatusCode.NoContent);
            }

            _commandInvoker.Execute(new AddNewPostCommand()
            {
                Entry = post.Entry,
                Title = post.Title
            });

            return new HttpResponseMessage(HttpStatusCode.OK);
        }
        public HttpResponseMessage<Post> PostBlogPost(Post post)
        {
            var postExist = _postReadQueries.GetByTitle(post.Title);

            if (postExist == null)
            {
                _commandInvoker.Execute(new AddNewPostCommand()
                                            {
                                                Entry = post.Entry,
                                                Title = post.Title
                                            });

                var addedPost = _postReadQueries.GetByTitle(post.Title);
                var response = new HttpResponseMessage<Post>(addedPost, HttpStatusCode.Created);

                var uri = Url.Route(null, new { id = addedPost.Id });
                response.Headers.Location = new Uri(Request.RequestUri, uri);

                return response;
            }

            return new HttpResponseMessage<Post>(postExist, HttpStatusCode.Found);
        }
        public void PutPost(string id, Post post)
        {
            var postExist = _postReadQueries.GetById(post.Id);

            if (postExist == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            _commandInvoker.Execute(new UpdatePostCommand()
                    {
                        Entry = post.Entry,
                        Title = post.Title,
                        Id = post.Id
                    });
        }