我试图选择表中最常见的前五个值,并将其返回到列表中。
var mostFollowedQuestions = (from q in context.UserIsFollowingQuestion select *top five occuring values from q.QuestionId*).toList();
任何的想法?
谢谢
var mostFollowedQuestions = context.UserIsFollowingQuestion .GroupBy(q => q.QuestionId) .OrderByDescending(gp => gp.Count()) .Take(5) .Select(g => g.Key).ToList();