Am having a list object. i need to add the values in the object in a single line of code without using foreach or for loop. Is it possible using the linq query??
For eg: am having a list object userCount of length 2. I need to find the TotalManagerCount by adding the ManagerCount values in the list.
public class UserCount
{
public int ManagerCount {get; set;}
public int EngineerCount {get; set;}
}
List<UserCount> userCount = new List<UserCount>();
int TotalManagerCount = ??
int TotalEngineerCount = ??
Thanks in advance
Dinesh.