title: how to pass any method as a parameter for another function
body: <p>In class A, I have</p>
  
  <pre><code>internal void AFoo(string s, Method DoOtherThing)
  {
      if (something)
      {
          //do something
      }
      else
          DoOtherThing();
  }
  </code></pre>
  
  <p>Now I need to be able to pass <code>DoOtherThing</code> to <code>AFoo()</code>. My requirement is that <code>DoOtherThing</code> can have any signature with return type almost always void. Something like this from Class B,</p>
  
  <pre><code>void Foo()
  {
      new ClassA().AFoo("hi", BFoo);
  }
  
  void BFoo(//could be anything)
  {
  
  }
  </code></pre>
  
  <p>I know I can do this with <code>Action</code> or by implementing delegates (as seen in many other SO posts) but how could this be achieved if signature of the function in Class B is unknown??</p>