Skip to content

Instantly share code, notes, and snippets.

@jmkelly
Created June 23, 2015 23:08
Show Gist options
  • Save jmkelly/007a5cd4e95e975d51f8 to your computer and use it in GitHub Desktop.
Save jmkelly/007a5cd4e95e975d51f8 to your computer and use it in GitHub Desktop.
request container resolve nancy
using Nancy;
using Nancy.TinyIoc;
namespace NancyBlankTest
{
public class CustomBootstrapper : DefaultNancyBootstrapper
{
protected override void ConfigureRequestContainer(TinyIoCContainer container, NancyContext context)
{
container.Register<IOwinContext, OwinContext>();
}
}
public class MyModule : NancyModule
{
public MyModule(IOwinContext owinContext)
{
Get["/"] = _ =>
{
//do whatever you want with the context
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment