title: C# Func<T,TResult> arguments validation
body: <p>Imagine the Func <code>Func&lt;Arguments, bool?&gt;</code>, where <code>Arguments</code> is an abstract class. Somewhere, for some reason I create a list of these functions with all kind of derived classes as arguments. Of course the type of <code>Arguments</code> is important for validation before the <code>Func</code> is called. Is there a way to get the type of <code>Arguments</code>?</p>
  
  <p>e.g.:</p>
  
  <pre><code>public bool? test(Arguments arg) {
      Func test    = Func&lt;SomeArguments, bool?&gt;;
      Type argType = GetFirstArgumentType(test); // gives SomeArguments.GetType();
  
      if (arg.GetType() == argType) {
          return test(new SomeArguments());
      }
      return null;
  }
  </code></pre>