LINQ and IEnumerable?

I

Ivan

Trying your example:

decimal ss = (decimal)(from a in Items select (decimal) a.Price).Sum();

Get error:

Error 21 Could not find an implementation of the query pattern for source
type 'System.Collections.IEnumerable'. 'Select' not found. Consider
explicitly specifying the type of the range variable 'a'.
 
I

Ivan

Trying your example:

decimal ss = (decimal)(from a in Items select (decimal) a.Price).Sum();

Get error:

Error 21 Could not find an implementation of the query pattern for source
type 'System.Collections.IEnumerable'. 'Select' not found. Consider
explicitly specifying the type of the range variable 'a'.
 
I

Ivan

Same error:

Error 21 Could not find an implementation of the query pattern for source
type 'System.Collections.IEnumerable'. 'Select' not found. Consider
explicitly specifying the type of the range variable 'a'.
 
I

Ivan

Same error:

Error 21 Could not find an implementation of the query pattern for source
type 'System.Collections.IEnumerable'. 'Select' not found. Consider
explicitly specifying the type of the range variable 'a'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top