Blog.Logic.Core.PostsLogic.GetMoreRecentPosts C# (CSharp) Method

GetMoreRecentPosts() public method

public GetMoreRecentPosts ( int postsCount, int skip ) : List
postsCount int
skip int
return List
        public List<Post> GetMoreRecentPosts(int postsCount, int skip)
        {
            var posts = new List<Post>();
            try
            {
                var db = _postRepository.GetMoreRecentPosts(a => a.PostId > 0, postsCount, skip).ToList();
                db.ForEach(a => posts.Add(PostMapper.ToDto(a)));
                posts.ForEach(a => GetPostProperties(a));
            }
            catch (Exception ex)
            {
                throw new BlogException(ex.Message, ex.InnerException);
            }
            return posts;
        }