using System.Collections.Generic;
using System.Data.SqlClient;
using System.Threading.Tasks;
public int Index { get; set; }
public string Name { get; set; }
public int Count { get; set; }
public Monster(int index, string name, int count)
public static void Main()
List<Monster> listA = new List<Monster>();
listA.Add(new Monster(0, "snails", 600));
listA.Add(new Monster(1, "slimes", 300));
List<Monster> listB = new List<Monster>();
listB.Add(new Monster(0, "snails", 72));
List<Monster> listC = new List<Monster>();
listC.Add(new Monster(0, "snails", 300));
listC.Add(new Monster(1, "slimes", 371));
listC.Add(new Monster(10, "trolls", 152));
.GroupBy(x => new { x.Index ,x.Name })
.Select(x=> new Monster(x.Key.Index,x.Key.Name,x.Sum(z=>z.Count)));
foreach(var item in reuslt)
Console.WriteLine(string.Format("index:{0} name:{1} count:{2}",item.Index,item.Name,item.Count));