Skip to content

Instantly share code, notes, and snippets.

@thecodejunkie
Created November 27, 2012 21:42
Show Gist options
  • Save thecodejunkie/4157277 to your computer and use it in GitHub Desktop.
Save thecodejunkie/4157277 to your computer and use it in GitHub Desktop.
Automatic dependency resolution in Nancy
public class Demo : NancyModule
{
public Demo(MyDependency dependency)
{
Get["/{name}"] = parameters => {
return dependency.GetMessage(parameters.name);
};
}
}
public class MyDependency
{
public string GetMessage(string name)
{
return string.Concat("Hi, ", name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment