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:
01605450
Views:
39
>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 ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform