Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Group By Linq Query

$
0
0

Hi Guys,

I have to get below result using Linq Group by.

UK 2 

US 1

Canada 3

Below is data in List Object

   List<LevelPrefix> LevelList = new List<LevelPrefix>
            {
                new LevelPrefix() { Type ="Event1",  Name ="UK"},
                new LevelPrefix() { Type ="Event1",  Name ="UK"},
				new LevelPrefix() { Type ="Event1",  Name ="US"},
				new LevelPrefix() { Type ="Event1",  Name ="Canada"},
				new LevelPrefix() { Type ="Event1",  Name ="Canada"},
				new LevelPrefix() { Type ="Event1",  Name ="Canada"}

            };

Many Thanks


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>