Пример #1
0
 private string QueryResult()
 {
     return(string.Join('|', (from comment in SocialNetwork.Descendants().OfType <Comment>()
                              let layering = Layering <IUser> .CreateLayers(comment.LikedBy, u => u.Friends.Where(f => f.Likes.Contains(comment)))
                                             orderby layering.Sum(l => Square(l.Count))
                                             select comment.Id).Take(3)));
 }
Пример #2
0
 private string QueryResult()
 {
     return(string.Join('|', (from comment in SocialNetwork.Descendants().OfType <Comment>()
                              let layering = Layering <IUser> .CreateLayers(comment.LikedBy, u => u.Friends.Intersect(comment.LikedBy))
                                             let score = layering.Sum(l => Square(l.Count))
                                                         orderby(score, comment.Timestamp) descending
                                                         select comment.Id).Take(3)));
 }