I have a problem with the following code which should work, according to this MSDN Forums post.
using System;
using System.Collections.Generic;
using System.
You have to name the property used to store Sum method result:
select new { g.Key.empid, g.Key.weekending, Sum = g.Sum(s=>s.hours)};
Compiler can't infer the property name when you're assigning the value from expression:
Anonymous Types (C# Programming Guide)
You must provide a name for a property that is being initialized with an expression (...)