Created
March 4, 2013 19:41
-
-
Save gerektoolhy/5084877 to your computer and use it in GitHub Desktop.
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
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