所以我有一个 IEnumerable CallsForProperty 我需要找到特定时间段的前 3 个问题,所以我创建了 3 个字典
Dictionary<int, string> FAQfor3Months = null;
Dictionary<int, string> FAQfor4to12Months = null;
Dictionary<int, string> FAQfor12plusMonths = null;
foreach(Activity call in CallsForProperty){
if( /*call is in 3 months*/ ){
//do some unrelated stuff
FAQfor3Months.Add(counter, call.callQuestion)
counter++;
}
}
我有 2 个问题,
我试图找出最常见的 3 个问题,这个查询正确吗?
var threeMonthFaqs = FAQfor3Months.GroupBy(x => x.Value).OrderByDescending(x => x.Count()).Take(3);
这也太低效了吧?有没有更好的方法来查询集合?
慕的地6264312
繁星点点滴滴