score:8
Accepted answer
var data = products.orderbydescending(x => x.total);
score:2
change:
var productsbygreatestquantity = products.orderby(x => x.total);
to:
var productsbygreatestquantity = products.orderbydescending(x => x.total);
Source: stackoverflow.com
Related Query
- How do you order by Greatest number in linq
- How do you sort a String List by the number of words matched with an Array in Linq
- linq - how do you do a query for items in one query source that are not in another one?
- In LINQ to Entities, How can you order like follows?
- Is LINQ to XML order dependent and can you number results with it?
- How can I check the number of calls to the database in LINQ query when using .NET Core and Code First?
- LINQ to entites: How to return the latest order number for a customer
- How do you perform a left outer join using linq extension methods
- How do you perform a CROSS JOIN with LINQ to SQL?
- Linq Order by a specific number first then show all rest in order
- How do you add an index field to Linq results
- How are people unit testing code that uses Linq to SQL
- How can you handle an IN sub-query with LINQ to SQL?
- How do you construct a LINQ to Entities query to load child objects directly, instead of calling a Reference property or Load()
- How To Project a Line Number Into Linq Query Results
- How do you use LINQ to find the duplicate of a specific property?
- How to count the number of elements that match a condition with LINQ
- How do you use LINQ with Sqlite
- How do I get LINQ to order according to culture?
- How do you add dynamic 'where' clauses to a linq query?
- How to use Linq to group every N number of rows
- How to count the number of code lines in a C# solution, without comments and empty lines, and other redundant stuff, etc?
- How would you write an Upsert for LINQ to SQL?
- How do you handle arbitrary namespaces when querying over Linq to XML?
- How do I count the number of child collection's items using LINQ Method Syntax?
- How can you do custom sorting in LINQ with null always on the end?
- Can you reverse order a string in one line with LINQ or a LAMBDA expression
- How to use LINQ to order within groups
- How would you implement LINQ methods with SelectMany?
- How do you extend Linq to SQL?
More Query from same tag
- Sub divide a dictionary into smaller parts
- Linq use property name equality
- How Linq infers types from Lambda
- Adding IEnumerable to ViewState
- Looping Through LINQ Queries and Appending Results to DataTable
- group by and sum using linq
- Using a where condition within an inner element in XML
- Selectively remove from where clause in LINQ expression tree
- How can i create sublist inside a xml
- C# DataTable How to sort the solution after grouping?
- Aggregate values and time using LINQ C#
- uint.Parse on a valid string throws System.FormatException: 'Input string was not in a correct format.'
- Display contains for integer array using ternary operator in C#
- How does one populate multiple lists with a LINQ statement
- Where Clause on Joined Table with Into Keyword
- How to get Max String Length in every Column of a Datatable
- Optimize a query or suggest LINQ equivalent
- Read XML file which is referring another xml file
- VB.NET LINQ To DataTable Select with Where Clause
- How to show one page per record, with pagination?
- Can't do multiple selects on a table for columns
- Using inner .Any() is it the same as doing two seperate checks
- Linq to build hierarchical list
- How I can combine query these data
- Linq DataTable Having Query
- Is it possible to change & to & in the results from a LINQ query?
- LINQ Refactoring
- How do I properly convert a string to decimal in my linq query?
- Is null-checking on Linq queries idiomatic?
- Order alphanumeric string numerically, and then by prefix/suffix