using System.Collections.Generic;
public static void Main()
var type = new List<int>() { 1, 2, 3, 4, 3 , 2, 1 };
var classes = new List<Tov>()
new Tov(1, "Автомобиль"),
v.ToList().ForEach(t=> Console.WriteLine("Key={0}, Count={1}", t.Key, t.Count()));
Console.WriteLine(new string('-', 20));
select new { Type = t, Mass = mass };
v2.ToList().ForEach(t => Console.WriteLine("Key={0}, Count={1}", t.Type, t.Mass.Count()));
public Tov(int id, string val)