Example #1
0
        public IEnumerable <PostEntity> GetTagPostsAsync(string tag)
        {
            var postIds = _postTagService.GetPostsWithParticularTag(tag).ToList();

            var posts = _postRepository
                        .Where(p => postIds.Contains(p.Id))
                        .OrderByDescending(c => c.CreatedAt);

            return(posts.Select(p => _mapper.Map <PostEntity>(p)));
        }