I want to do this
return array.Any(IsOdd);
but instead of an array i have a list of objects where IsOdd takes in the object.Number property as its argument.
I tried this
return objectList.Select(x => x.Number).Any(IsOdd);
but got this error “‘Select’ is not a member of ‘System.Collections.Generic.List(Of myObject)’.”
Also my code is actually in VB and I’m using vs 2010 but targeting .net 2.0.
Updated answer
There is no official way to use LINQ in .NET 2.0, although if you are only interested in LINQ to Objects there’s LINQBridge to help.
Original answer
First off, you can simply use the other overload of
Anyand writeAnd second, this sounds like you have forgot
using System.Linqin your file — although in that case, straight callingAnywould not work either.