title: Is Func<in T, out TResult> appropriate to use as a ctor arg when applying Dependency Injection?
body: <p>Example:</p>
  
  <pre><code>public class BusinessTransactionFactory&lt;T&gt;  where T : IBusinessTransaction
  {
      readonly Func&lt;Type, IBusinessTransaction&gt; _createTransaction;
  
      public BusinessTransactionFactory(Func&lt;Type, IBusinessTransaction&gt; createTransaction)
      {
          _createTransaction = createTransaction;
      }
  
      public T Create()
      {
          return (T)_createTransaction(typeof(T));
      }
  }
  </code></pre>
  
  <p>Container setup code utilising same:</p>
  
  <pre><code>public class DependencyRegistration : Registry
  {
      public DependencyRegistration()
      {
          Scan(x =&gt;
          {
              x.AssembliesFromApplicationBaseDirectory();
              x.WithDefaultConventions();
              x.AddAllTypesOf(typeof(Repository&lt;&gt;));
              x.ConnectImplementationsToTypesClosing(typeof(IRepository&lt;&gt;));
          });
  
          Scan(x =&gt;
          {
              x.AssembliesFromApplicationBaseDirectory();
              x.AddAllTypesOf&lt;IBusinessTransaction&gt;();
              For(typeof(BusinessTransactionFactory&lt;&gt;)).Use(typeof(BusinessTransactionFactory&lt;&gt;));
              For&lt;Func&lt;Type, IBusinessTransaction&gt;&gt;().Use(type =&gt; (IBusinessTransaction)ObjectFactory.GetInstance(type));
          });
  
  
          For&lt;ObjectContext&gt;().Use(() =&gt; new ManagementEntities());
      }
  }
  </code></pre>
  
  <p>What do you think?</p>