public override IList <WeblogMinimalPost> GetPosts([FromBody] PostListFilter listFilter) { var posts = PostBusiness.GetLastPosts(listFilter.NumberOfPosts); var postList = new List <WeblogMinimalPost>(); foreach (var post in posts) { postList.Add(item: new WeblogMinimalPost() { PostId = post.Id.ToString(), Title = post.Title, Abstract = post.Abstract, Created = post.Created, Url = PostBusiness.GetPostUrl(post), ImageUrl = post.ImageUrl, CommentCount = post.CommentCount, }); } return(postList); }
/// <summary> /// /// </summary> /// <param name="listFilter"></param> /// <returns></returns> public abstract IList <WeblogMinimalPost> GetPosts(PostListFilter listFilter);