title: Nancy create singleton with constructor parameters
body: <p>I'm using Nancy with TinyIoC to solve the dependencies.</p>
  
  <p>One dependency in particular needs to be application-lifecycle singleton.</p>
  
  <p>If I do it with a default constructor it works:</p>
  
  <pre><code>container.Register&lt;IFoo, Foo&gt;().AsSingleton();   // WORKS
  </code></pre>
  
  <p>but if i try this with some arguments on the contructor it does not:</p>
  
  <pre><code>container.Register&lt;IFoo&gt;((c, e) =&gt; new Foo("value", c.Resolve&lt;ILogger&gt;())).AsSingleton();
  // FAILS with error "Cannot convert current registration of Nancy.TinyIoc.TinyIoCContainer+DelegateFactory to singleton"
  </code></pre>
  
  <p>Whithout <code>.AsSingleton()</code>, it works again, but I don't get a singleton:</p>
  
  <pre><code>container.Register&lt;IFoo&gt;((c, e) =&gt; new Foo("value", c.Resolve&lt;ILogger&gt;()));
  // Works, but Foo is not singleton
  </code></pre>
  
  <p>Any Ideas? I think the mistake should be obvious but I can't find it.
  I've used up all my google-foo.</p>
  
  <hr>
  
  <h2>EDIT</h2>
  
  <p>The code runs here:</p>
  
  <pre><code>public class Bootstrapper : DefaultNancyBootstrapper
  {
      protected override void ConfigureApplicationContainer(TinyIoCContainer container)
      {
          base.ConfigureApplicationContainer(container);
  
          // here 
      }
  }
  </code></pre>