// POST: api/Posts
        public IHttpActionResult Post([FromBody] Post post)
        {
            var result = postService.AddNew(post);

            return(Ok(new
            {
                Success = result,
                ListPosts = postService.FindByBlogId(post.BlogId)
            }));
        }
Beispiel #2
0
        public ActionResult AddNewPost(Post post)
        {
            var result = postService.AddNew(post);

            return(Json(new
            {
                Success = true,
                ListPosts = postService.FindByBlogId(post.BlogId),
                IsSuccessAddNewPost = result
            }, JsonRequestBehavior.AllowGet));
        }