I have got a list which looks like this for example:
Id = 1, Name = Microsoft, Country = USA, Match = null
Id = 2, Name = Google, Country = USA, Match = null
Id = 1, Name = Microsoft, Country = USA, Match = null
Now I would like to group the list by name which I did like this:
var List = result.GroupBy(x => x.Name).ToList();
My goal is to safe the number of duplicates into Match.
So that the list looks like this:
Id = 1, Name = Microsoft, Country = USA, Match = 2
Id = 2, Name = Google, Country = USA, Match = 1
Thanks in advance!