Created
June 23, 2015 23:08
-
-
Save jmkelly/007a5cd4e95e975d51f8 to your computer and use it in GitHub Desktop.
request container resolve nancy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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