On Thu, 2010-07-01 at 15:09 +0800, Erickson Qua wrote:
> is there a temporary workaround/fix?

Not really.  The issue is that creating new instances of object outside
of Queryable.Select() isn't supported, and you're attempting to create a
new instance within Queryable.GroupBy().  The only workaround is to
remove the 'new'; string concat might work:

        var results = from o in db.Orders
                      group o by o.ShipName + "|" + o.Freight + "|" + 
o.OrderDate into myGroup
                      where myGroup.First().OrderDate >= fromDate && 
myGroup.First().OrderDate < toDate
                      orderby myGroup.First().ShipName
                      select new { myGroup.First().ShipName, 
myGroup.First().Freight};

(Note: completely untested, shown only for demonstrative purposes).

 - Jon


-- 
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en.

Reply via email to