In regular SQL i could do something like
SELECT * From T GROUP BY DATEPART(wk, T.Date)
How can i do that in Linq to SQL ?
The follo
If you are concerned about the culture you are in the following code will take that into account:
var ci = CultureInfo.CurrentCulture;
var cal = ci.Calendar;
var rule = ci.DateTimeFormat.CalendarWeekRule;
var firstDayOfWeek = ci.DateTimeFormat.FirstDayOfWeek;
var groups = from F in DB.T
group F by cal.GetWeekOfYear(F, rule, firstDayOfWeek) into R
select R;