title: c# passing method as the argument in a method
body: <p>I have a recuring method which shows up many times in my code its basically checking to make sure that the connection to the odbc is ok and then connects but each time this method is called it calls another method and each instance of the main method this one is different, as each method is about 8 lines of code having it 8 times in the code isnt ideal.</p>
  
  <p>so basically i would like to have just one method which i can call passing the name of the new method as an arguement.</p>
  
  <p>so basically like:</p>
  
  <p><code>private void doSomething(methodToBeCalled)
  {
    if(somthingistrue)
     {
        methodToBeCalled(someArgument)
      }
  }</code></p>
  
  <p>is this possible?</p>
  
  <p>thanks in advance</p>