title: How to create a delegate to an instance method with a null target?
body: <p>I've noticed that the Delegate class has a Target property, that (presumably) returns the instance the delegate method will execute on. I want to do something like this:</p>
  
  <pre><code>void PossiblyExecuteDelegate(Action&lt;int&gt; method)
  {
      if (method.Target == null)   
      {
          // delegate instance target is null
          // do something
      }
      else
      {
           method(10);
           // do something else
      }
  }
  </code></pre>
  
  <p>When calling it, I want to do something like:</p>
  
  <pre><code>class A
  {
      void Method(int a) {}
  
      static void Main(string[] args)
      {
          A a = null;
          Action&lt;int&gt; action = a.Method;
          PossiblyExecuteDelegate(action);
      }
  }
  </code></pre>
  
  <p>But I get an ArgumentException (Delegate to an instance method cannot have a null 'this') when I try to construct the delegate. Is what I want to do possible, and how can I do it?</p>