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

GetPostsByTag() public method

public GetPostsByTag ( string tagName ) : List
tagName string
return List
        public List<Post> GetPostsByTag(string tagName)
        {
            var posts = new List<Post>();
            try
            {
                var db = _postRepository.GetPostsByTag(tagName).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;
        }