Correction: this scenario doesn't work too.
from c in meta.Customer
join o in meta.Order on c.CustomerID equals o.CustomerID
group o by c[b].CustomerID[/b] into g
select g;
Neither this one:
from c in meta.Customer
join o in meta.Order on c.CustomerID equals o.CustomerID
group o.[b]OrderID[/b] by c[b].CustomerID[/b] into g
select g;
These work:
from c in meta.Customer
join o in meta.Order on c.CustomerID equals o.CustomerID
group o by c[b].CustomerID[/b] into g
select new { g.Key,Counter = g.Count()};
from c in meta.Customer
join o in meta.Order on c.CustomerID equals o.CustomerID
group o.[b]OrderID[/b] by c[b].CustomerID[/b] into g
select new { g.Key,Counter = g.Count()};
It seems whenever the select is made on the grouping variable without further calculations the expression throws exception.