Here I need to get the total number of Murugan titles, my output should be "2". How to write a Linq query for this
Linq:
Person[] names = {new Person { Name = "Murugan", Money = 15000 }, new Person{Name="Vel",Money=17000}, new Person{Name="Murugan",Money=1000}, new Person{Name="Subramani",Money=18000}, new Person{Name="Vel",Money=2500}}; var result = from val in names where val.Name == "Murugan" select val; Console.WriteLine(result); Console.ReadLine();
source share