title: Ninject - Extracting instance instantiation to a separate project / class
body: <p>I'm trying to extract Binding of interfaces to classes that implement them and instance instantiation to a separate project.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code> public class DependencyModule : NinjectModule
      {
          public override void Load()
          {
              Bind&lt;IMyClass&gt;().To&lt;MyClass&gt;();
          }
      }
  </code></pre>
  
  <p>This is my module.
  And in this class I want to create a static method, that when passed any interface tries to find class that's bind to it and return an instance of it:</p>
  
  <pre><code>public static class Resolver&lt;T, U&gt;
      {
          public static T GetInstance&lt;T&gt;(U requestedInterfaceInstance)
          {
              var kernel = new StandardKernel(new DependencyModule());
  
              return kernel.Get&lt;requestedInterfaceInstance&gt;();
          }
      }
  </code></pre>
  
  <p>So, My guess is that I need two type parameters? One for return type of the object I want to return (e.g MyClass instance), and one for my method parameter, which in this case would be (IMyClass).</p>
  
  <p>How can I accomplish this in a better way? Thanks.</p>