using System.Collections;
using System.Collections.Generic;
public static void Main()
Console.WriteLine("Hello World");
var table = new List<Row>();
table.Add(new Row{ID=1,Week=1,Value = 1000});
table.Add(new Row{ID=2,Week=1,Value = 1000});
table.Add(new Row{ID=3,Week=2,Value = 1000});
table.Add(new Row{ID=4,Week=3,Value = 1000});
table.Add(new Row{ID=5,Week=3,Value = 1000});
table.Add(new Row{ID=6,Week=3,Value = 1000});
var weeks = new List<int>{1,2,3,4};
select new {week = g.Key, count = g.Count()}) on w equals rw.week into p
from x2 in p.DefaultIfEmpty()
select new {w, count = (x2 != null ? x2.count : 0)};
x.ForEach(i=> Console.WriteLine(i));
public int Week {get;set;}
public int Value {get;set;}