- Instead of putting it into an own list by calling
ToList()
orToArray()
i would prefer to useAsEnumerable()
. - Additionally like the others you should try
OrderByDescending()
- Instead of
Count()
i would useAny()
.
More Related Contents:
- LINQ – Left Join, Group By, and Count
- Am I misunderstanding LINQ to SQL .AsEnumerable()?
- LINQ Where Ignore Accentuation and Case
- Operation could destabilize the runtime?
- How to select only the records with the highest date in LINQ
- DISTINCT() and ORDERBY issue
- Max or Default?
- How do I do a left outer join with Dynamic Linq?
- Get sum of two columns in one LINQ query
- Linq where column == (null reference) not the same as column == null
- Get all checked nodes of a treeview
- Difference Between Select and SelectMany
- How to flatten tree via LINQ?
- Using LINQ to remove elements from a List
- When should I dispose of a data context
- Extension methods must be defined in a non-generic static class
- LINQ to SQL and a running total on ordered results
- C# – code to order by a property using the property name as a string [duplicate]
- How to return anonymous type from c# method that uses LINQ to SQL [duplicate]
- Can I specify my explicit type comparator inline?
- Updating an ObservableCollection in a separate thread
- Convert Linq Query Result to Dictionary
- Can I split an IEnumerable into two by a boolean criteria without two queries?
- Will using LINQ to SQL help prevent SQL injection
- Remove Item in Dictionary based on Value
- Issues Doing a String Comparison in LINQ
- Should the order of LINQ query clauses affect Entity Framework performance?
- Map two lists into a dictionary in C#
- Is Injection Possible through Dynamic LINQ?
- Can I use Linq’s Except() with a lambda expression comparer?