title: C# function that takes pointer to function as an in parameter without declaring any specific delegate types?
body: <p>I want to implement a method that will find stuff in my custom class. It should work like generic collections work - i pass a pointer to a function, and the method will iterate through all it has to look in, apply this function, and if it returns true return the found item.</p>
  
  <p>I'd like to pass function pointer as a parameter, but i dont want to declare delegate types.</p>
  
  <p>I know i can do something like:</p>
  
  <pre><code>delegate bool Foo(MyClass)
  MyClass MyMethod(Foo x)
  {...}
  </code></pre>
  
  <p>And i know i can do something like this:</p>
  
  <pre><code>MyClass MyMethod(Func&lt;MyClass,bool&gt; x)
  </code></pre>
  
  <p>But can i do it without declaring a delegate type and without using built in stuff like Func&lt;> which has limits on how many parameters i can have (in case of Func, one...)</p>