Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie to Linq
Message
General information
Forum:
ASP.NET
Category:
LINQ
Title:
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01605340
Message ID:
01605485
Views:
36
Hi,

Glad you got it working. Of course the snag with anonymous types is that you can't use them outside the method - if you need to do that then you'll need a matching concrete class.

BTW it looks as if the problem with my original suggestion lies in the way in which it is compiled to SQL - see my recent post to Rob.....


>Just to update you Viv your anonymous type code worked perfectly as well - thanks again.
>
>Edit
>
>This is what I've settled on
>
>
>var results = Context.invoices.Where(x => x.invoiceamount >= InvoiceAmount).GroupBy(x => x.client)
>                .Select(group => new { companyname = group.Key.companyname,Id = group.Key.id, invoices = group.OrderByDescending(x => x.invoiceamount) })
>             .OrderByDescending(group => group.invoices.Sum(x => x.invoiceamount)).ToList();
>
Previous
Reply
Map
View

Click here to load this message in the networking platform