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:
01605450
Vues:
40
>No difference Viv - v strange

Seems odd. GroupBy() shouldn't disrupt to previous OrderBy. You could try:
var results = (Context.invoices // Start at invoices because this is the list we really care about
                    .Include(inv => inv.client) // Eager load the client so it doesn't require additional queries
                    .Where(inv => inv.invoiceamount >= InvoiceAmount)
                    .OrderBy(x=x.cientid)
                    .ThenByDescending(x => x.invoiceamount)// Filter results
                    .GroupBy(inv => inv.client) // Group results by client so we can loop through the clients
                    .ToList()); // Execute the query
If that doesn't work I'm running out of ideas :-}
Unless you can use an anonymous type ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform