Skip to content

Instantly share code, notes, and snippets.

@tugberkugurlu
Forked from thecodejunkie/gist:4157277
Created November 27, 2012 21:53
Show Gist options
  • Save tugberkugurlu/4157372 to your computer and use it in GitHub Desktop.
Save tugberkugurlu/4157372 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