title: How can I pass in a func with a generic type parameter?
body: <p>I like to send a generic type converter function to a method but I can't figure out how to do it.</p>
  
  <p>Here's invalid syntax that explains what I like to achieve, the problem is I don't know how to specify the generic type together with my func:</p>
  
  <pre><code>public void SomeUtility(Func&lt;T&gt;&lt;object,T&gt; converter)
  {
      var myType = converter&lt;MyType&gt;("foo");
  }
  </code></pre>
  
  <p>Edit (see also my discussion in the comments with Lawrence) : By "generic type converter" I meant I would like to pass in a converter that can convert to any strong type &lt;T&gt; (not object), so the next line in my method could be:</p>
  
  <pre><code>var myOtherType = converter&lt;MyOtherType&gt;("foo");
  </code></pre>
  
  <p>The delegate I like to pass as a parameter would look something like this:</p>
  
  <pre><code>private delegate TOutput myConverterDelegate&lt;TOutput&gt;(object objectToConvert);
  </code></pre>
  
  <p>This is more a syntax / C# exploration now, to get things done I will probably use an interface instead, but I do hope this is possible to accomplish with a func/delegate.</p>