In a specific project at my work, I have a method that returns IList. But this interface does not contain where, or FindAll filters. However, when I open a new project, IList contains all. What is the difference?
Thanks so much. What a stupid mistake...
ozancali
2010-07-21 11:06:21
You should accept ScottE's answer if it's the right one.
Will Dean
2010-07-21 11:20:16
@bileyazan - I agree with @Will Dean, it's important to accept answers that help you out from SO. It doesn't just give the answerer reputation, it lets future googlers know which answer helped you figure out your problem.
Dave McClelland
2010-07-21 13:06:11
+4
A:
Nope. IEnumerable<T>
has "where" as an extension method.
Assuming your project is .Net 3.5 or greater, you need to have using System.Linq;
Brian Genisio
2010-07-21 11:05:46
`IEnumerable<T>` you mean. :) The plain old `IEnumerable` is not supported by LINQ - you have to do `Cast`/`OfType` first.
Noldorin
2010-07-21 12:58:41
@Noldorin: Yeah, I actually had `<T>`, but I forgot to put it in a code block and StackOverflow lost it... probably got rendered as a HTML tag. Thanks :)
Brian Genisio
2010-07-21 13:03:31
A:
You might find this useful: http://stackoverflow.com/questions/1938204/linq-where-vs-findall
Will Dean
2010-07-21 11:06:14
A:
Check .NET Framework of opened framework, may be its .NET Fx 2.
System.Linq added in 3.5
Sandy
2010-07-21 11:06:44
A:
Here's a basic discussion of extension methods in general. As mentioned by others, the Where method is an extension method found in the System.Linq namespace so you need to import it in order to have intellisense detect the existence of those methods.
Steve Mitcham
2010-07-21 12:56:48