using System.Collections.Generic;
public static void Main()
var testData = new List<ProjectResult>(){
Month = "1", Name = "Januar"
Month = "1", Name = "Februar"
Month = "2", Name = "Januar"
Month = "2", Name = "Februar"
var res = GenerateDynamicCalendar(testData);
foreach(var line in res){
Console.WriteLine($"counter: {line.Counter}, month: {line.Month}, name: {line.Name}");
public static List<ProjectOutput> GenerateDynamicCalendar(List<ProjectResult> input) {
var result = new List<ProjectOutput>();
var queryAug = input.GroupBy(c => new { c.Month});
foreach(var grouping in queryAug){
grouping.Select(it => new ProjectOutput{ Counter = counter++, Name = it.Name, Month = it.Month } )
public class ProjectResult {
public string Month {get;set;}
public string Name {get;set;}
public class ProjectOutput {
public int Counter {get;set;}
public string Month {get;set;}
public string Name {get;set;}