public JsonResult GetPostByID(string id) { Post post = new Post(); post.content = "Post Not Found"; WordPressBlog blog = wpc.GetBlog(); post = blog.GetPostByID(Int32.Parse(id)); return(Json(post)); }
public ActionResult Index() { WordPressBlog blog = wpc.GetBlog(); posts = blog.GetTop3Posts(); PostViewModel postViewModel = new PostViewModel(); foreach (var post in posts) { post.excerpt = post.excerpt.CharacterLimit(75); } postViewModel.Posts = posts; return(View(postViewModel)); }