score:3
Accepted answer
you are trying to use the system.linq.queryable.where
extension method, but your code thinks you want system.data.objects.objectquery.where
.
make sure you have the correct imports system.linq
statement at the top of your file. if that doesn't work, you might have to directly call system.linq.queryable.where(testresults, ...).count
. you could also use count(predicate)
instead of where(predicate).count
, which might also avoid the conflict.
Source: stackoverflow.com
Related Query
- Anonymous type, cast as AsQueryable from an if statement and then queried
- Unable to cast Anonymous Type from 'System.Linq.IQueryable' to 'System.Data.Entity.Core.Objects.ObjectQuery'
- c#: Isn't Where(), OrderBy() and Select() from Enumerable Class supposed to take a delegate type, lambda expression or anonymous type as a parameter
- get selected value from combobox with data source is anonymous type
- How to cast LINQ generated anonymous data type list from DataView ASP .NET MVC?
- How can I filter a dictionary using LINQ and return it to a dictionary from the same type
- The specified cast from a materialized 'System.Int32' type to the 'System.Double' type is not valid
- How to return anonymous type from c# method that uses LINQ to SQL
- Return Anonymous Type from a function
- Linq Getting Customers group by date and then by their type
- anonymous type and multiple properties
- LINQ select query with Anonymous type and user Defined type
- This code returns distinct values. However, what I want is to return a strongly typed collection as opposed to an anonymous type
- How can I return an anonymous type from a method?
- Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
- Why does using anonymous type work and using an explicit type not in a GroupBy?
- C# Anonymous Type access from other method
- Can I take the first n elements from an enumeration, and then still use the rest of the enumeration?
- Anonymous Type with Linq and Guid
- SelectMany Anonymous Type and Skip Iterations
- LINQ query with GROUP BY and Count(*) into Anonymous Type
- How to convert Anonymous Type to Strong Type from LINQ query
- How can I cast a List into a type which inherits from List<T>?
- How to use Include and Anonymous Type in same query in Entity Framework?
- The specified cast from a materialized 'System.Int32' type to the 'System.Int64' type is not valid
- When selecting an anonymous type with LINQ from EF, is there no way to run a method on an object as you select it?
- LINQ to Entities, join two tables, then group and take sums of columns from both tables
- The given value of type String from the data source cannot be converted to type int of the specified target column
- How to cleverly create an anonymous type from an IEnumerable<T>?
- How do I get property names of a type using a lambda expression and anonymous type?
More Query from same tag
- LINQ to Entities three table join query
- Exception in Temporary created table in EF linq mocking
- how to use multiple order by in LINQ?
- WPF binding problem with LINQ-class
- Linq + foreach loop optimization
- Are some Funcs impossible to convert to equivalent Expressions?
- How to convert Expression<Func<T, bool>> to Expression<Func<Type, bool>>?
- LINQ to SQL - Using TransactionScope for SELECT statement - is call to Complete() necessary?
- Is it possible to determine if an IEnumerable<T> has deffered execution pending?
- Linq to SQL - How to find the value of the IDENTITY column after InsertOnSubmit()
- Finding multiple unique matches from List<object> where two criteria have to be different
- Linq: Dynamic Query Contruction: query moves to client-side
- C# LINQ. Searching for object by object name property or name part
- Null reference Exception when trying to parse XML to object List using LINQ to XML
- Sort and Match List Item
- LINQ left join with nullable values
- Is there an accepted name for this type of enumerable operation?
- select n records from nth record in linq
- Linq randomly returns periodic null results
- Select inside multiple interations
- Found Duplicate record in excel sheet using c# .net
- LINQ query help (LINQ to SQL)
- Return list of remaining elements in C#
- Getting stored procedure output parameter with LINQ and Entity Framework
- XML Retrieving 2 XElements from different trees
- Select Max() with GroupBy, using linq method syntax, EF
- Merging two lists into one by dates
- Issues in LINQ to SQL with String Contains Escape seqence of Backspace - C#
- LINQ to XML can't get element
- Find users based on a specific role