Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

linq select count group by c#

foreach(var line in data.GroupBy(info => info.metric)
                        .Select(group => new { 
                             Metric = group.Key, 
                             Count = group.Count() 
                        })
                        .OrderBy(x => x.Metric))
{
     Console.WriteLine("{0} {1}", line.Metric, line.Count);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: iterate through dictionary c# 
Csharp :: unity c# redirect to webiste 
Csharp :: db scaffolding ef core 
Csharp :: mvc select list order by 
Csharp :: how to update a project to cross target .net core 
Csharp :: c# array last element 
Csharp :: string to uint c# 
Csharp :: why vue cli do not refresh auto in local host 
Csharp :: link nuttom in c# 
Csharp :: c# print array 
Csharp :: if exist TempData[] c# 
Csharp :: nepali phone number regex 
Csharp :: how to open any file on button click in winforms 
Csharp :: how to write switch statement unity 
Csharp :: action being performed on this control is being called from the wrong thread c# 
Csharp :: C# executing assembly path 
Csharp :: orderbyascending c# 
Csharp :: how to convert a number to 2 decimal places in c# 
Csharp :: uni valued tree 
Csharp :: valid url in .net 
Csharp :: solve fizzbuz c# 
Csharp :: unity knowing when 0 input is pressed 
Csharp :: unity vscode launch.json 
Csharp :: set particle system start colour + random between two 
Csharp :: text split 
Csharp :: unity click on 2d object 
Csharp :: take screenshot in c# 
Csharp :: bootstrap modal 
Csharp :: audio source pause unity 
Csharp :: array.convertall 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =