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

GetPostsByCommunity() public method

public GetPostsByCommunity ( int communityId, int threshold = 10, int skip = 10 ) : List
communityId int
threshold int
skip int
return List
        public List<Post> GetPostsByCommunity(int communityId, int threshold = 10, int skip = 10)
        {
            var posts = new List<Post>();
            try
            {
                var db = _postRepository.GetByCommunity(communityId, threshold, 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;
        }