Blog.Logic.Core.PostContentsLogic.GetByPostId C# (CSharp) Method

GetByPostId() public method

public GetByPostId ( int postId ) : List
postId int
return List
        public List<PostContent> GetByPostId(int postId)
        {
            var postContents = new List<PostContent>();
            try
            {
                var db = _postContentRepository.Find(a => a.PostId == postId, true).ToList();
                db.ForEach(a =>
                {
                    a.Media.MediaPath = null;
                    a.Media.ThumbnailPath = null;
                    postContents.Add(PostContentMapper.ToDto(a));
                });
            }
            catch (Exception ex)
            {
                throw new BlogException(ex.Message, ex.InnerException);
            }
            return postContents;
        }