score:11
Accepted answer
var count = settings.favouritessetting.count(i => i.favouritetype != constants.favouritetype.folder);
return count.tostring();
score:0
var count = (from item in settings.favouritessetting
where item.favouritetype != constants.favouritetype.folder
select item).count();
return count.tostring();
Source: stackoverflow.com
Related Query
- Rewrite foreach statement to linq
- How do I convert Foreach statement into linq expression?
- What's elegant way to rewrite following LINQ statement using extension methods?
- Rewrite this foreach yield to a linq yield?
- LINQ Source Code Available
- LINQ ForEach Statement
- C# Linq query help removing foreach loops creating cleaner code
- Convert simple ForEach into a Linq statement
- I want to convert this foreach loop to a LINQ statement
- convert foreach loop to linq code
- creating Linq to sqlite dbml from DbLinq source code
- Using Linq to replace foreach statement
- Converting foreach loop to LINQ query breaks code
- Using linq within a ForEach statement
- How to rewrite a C# foreach in LINQ
- Is Linq and foreach in one statement preferable to 2 separate explicit statements?
- convert foreach to LINQ statement using where
- source code for LINQ 101 samples
- Retrieve a value from a generic List<T> using LINQ in a foreach statement
- Does using a LINQ statement in a foreach re-evaluate the statement on each iteration
- How to do condition statement in LINQ based on code variables?
- Convert if and foreach statement to select and where in linq
- Refactor foreach statement to LINQ
- C# LINQ Find List Inside Another List, Better way to code this than a foreach loop
- Replacing a foreach with a linq statement
- Convert the code from Foreach loop to Linq
- How to rewrite two loops into one LINQ statement
- Can I convert Dictionary loop inside of a foreach loop into a LINQ statement
- LINQ statement value to ForEach C# WPF MVVM
- Refactor C# foreach Loop into Linq Statement
More Query from same tag
- Entity Framework 5 dynamic select based on include
- How to do Linq query update
- Accessing XElement's attribute with Linq
- Data Conflict in LINQ
- Filter parent/child table (one to many association) in linq query based on entities in child table?
- Generate All customers total Sales Statement - using Linq
- Unable to Use IsLike operator on first table in nhibernate
- Difference between equals (LINQ) and == (C#) operators?
- How to avoid two foreach loops and assign conditionally property value from one to another?
- What will be LINQ MVC query equivalent to given SQL query?
- C# LINQ Orderby on parent only in hierarchical parent-child relationship data
- Why have a non-generic IQueryable?
- Avoid LINQ with Let keyword doing self-loop
- LINQ to Nhibernate (3.0) : GroupBy and Sum in subquery gives NoTImplemented
- SQL query with Group By and Having Clause in LINQ structure
- Wildcard search in using Lambda in EF
- How to use clause Except in queryable context
- How to get a dictionary with Linq where keys are met more than once?
- Selecting metadata using Linq and Reflection
- C# Dynamic Linq Ternary Operator
- Does the order of EF linq query clauses influence performance?
- Calling a Class Constructor in LINQ
- Linq left join and count - How To
- OrderBy is not working
- DataContext Accessed After Dispose
- Linq query takes far too long
- C# Comparison operators not supported for type Dictionary<string,string>
- C# / LINQ fastest way of comparing two lists and assigning value
- List inside other list performance
- Select value from group with the highest count