您可以GroupBy与一起使用ToDictionary:
GroupBy
ToDictionary
List list = new List() { 1, 2, 3, 1, 2, 3, 1, 2, 7, 2, 2 }; Dictionary counts = list.GroupBy(x => x) .ToDictionary(k => k.Key, v => v.Count());