title: Is it ok to pass Ninject Web.Common UseNinjectMiddleware a lambda which returns a kernel instance?
body: <p>Why does <code>UseNinjectMiddleware</code> take a lambda instead of a container instance?</p>
  
  <p>Is it OK to do this?</p>
  
  <pre><code>var container = CreateKernel();
  app.UseNinjectMiddleware(() =&gt; container);
  </code></pre>
  
  <p>instead of this:</p>
  
  <pre><code>app.UseNinjectMiddleware(() =&gt; CreateKernel);
  </code></pre>
  
  <p>My container instance in the first snippet is used to resolve dependencies in another part of my app. Does the Ninject Middleware need to be able to create it's own instances which it can modify, muck-around with and re-create at will? If not, I would like to avoid building the dependency tree more than once, hence why I'm wondering if it's OK for the lambda to just return the instance.</p>