Esempio n. 1
0
        public async Task <IEnumerable <Content> > GetListLatedPostAsync(int contentId, int number)
        {
            var content = await GetContentById(contentId);

            if (content != null)
            {
                var contentCategoryMap = _contentCategoryMapRepository.GetAll().FirstOrDefault(n => n.ContentId == contentId);
                if (contentCategoryMap != null)
                {
                    return(GetListContentsByCategory(contentCategoryMap.CategoryId, Common.ContentStatus.Published).Where(n => n.ContentId != contentId).Take(number));
                }
            }
            return(null);
        }