Esempio n. 1
0
        public static List <Typle <Post, Typle <int, int> > > GetCommentsStatistic(this IPostDao pDao, List <Post> posts, Guid forUser)
        {
            List <Guid> ids = posts.ConvertAll(p => p.ID);
            var         dic = pDao.GetCommentsStatistic(ids, forUser);

            var result = new List <Typle <Post, Typle <int, int> > >(posts.Count);

            foreach (var post in posts)
            {
                result.Add(new Typle <Post, Typle <int, int> >
                {
                    Value1 = post,
                    Value2 = dic[post.ID]
                });
            }

            return(result);
        }