Skip to content

Instantly share code, notes, and snippets.

@gerektoolhy
Created March 4, 2013 19:41
Show Gist options
  • Save gerektoolhy/5084877 to your computer and use it in GitHub Desktop.
Save gerektoolhy/5084877 to your computer and use it in GitHub Desktop.
public class DependencyModule : NancyModule
{
private readonly IApplicationDependency applicationDependency;
private readonly IRequestDependency requestDependency;
public DependencyModule(IApplicationDependency applicationDependency, IRequestDependency requestDependency)
{
this.applicationDependency = applicationDependency;
this.requestDependency = requestDependency;
Get["/dependency"] = x =>{
var model =
new RatPackWithDependencyText
{
FirstName = "Bob",
ApplicationDependencyText = this.applicationDependency.GetContent(),
RequestDependencyText = this.requestDependency.GetContent()
};
// why this will fail?
var repository = TinyIoCContainer.Current.Resolve<IApplicationDependency>();
return View["razor-dependency.cshtml", model];
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment