private IList GetArticlesByEdge(int tagId, int pageIndex, int pageSize) { IList articles = new List <Article>(); var edges = _tagDao.GetEdgeByTag(tagId, pageIndex, pageSize); foreach (ArticleTagEdge edge in edges) { var articleId = edge.ArticleId; var article = _articleDao.Get(articleId); articles.Add(article); } return(articles); }
public ArticleInfo[] GetTopN(UserInfo userInfo, int topN) { var articleIdList = _hitDao.GetResourceIds(0, topN, HitType.Article); var articleIds = articleIdList.Cast <int>().ToList(); var articles = _articleDao.Get(articleIds); var sortedArticles = SortArticles(articles, articleIds); return(_articleConverter.ToDataTransferObject(sortedArticles)); }