In the signature of a method I specify a Func, like so:
public void Method (Func<string, bool> func)
In LINQ, which method (from IEnumerable) will let me pass in a Func from the method parameter to the LINQ query? The other issue is, my func can have any type parameter(s) so the Method from IEnumerable/LINQ must support generic type placeholders.
I want to write something like this:
// Get all elements of type T from the webpage (find is an object in an external API to look for elements in a page).
IEnumerable<T> images = find.GetAllByTagName<T>().All(func);
// Where func is a method parameter which is assigned at run time by the consumer of this API:
public void Test (Func<T, bool> func) { }
How can I best do this? I am on .NET 3.5
Thanks