I am trying to get the sum of the value from list of list using linq ?my data is as below code
List> allData = new List<
var grouped = allData.GroupBy(x => x[0]) .Select(g => new { Name = g.Key, Sum = g.Sum(x => int.Parse(x[2])) });
It will return an anonymous type instance for each group, with two properties: Name with your grouping key and Sum with sum of marks.
Name
Sum