Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie to Linq
Message
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Titre:
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01605340
Message ID:
01605485
Vues:
35
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();
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform