2

For e.g I have NacyModule like:

public class HomeModule : NancyModule {
    public ILogger Logger { get; set; }
    public HomeModule() {
        Get["/"] = _ => "ok";
    }
}

I now about constructor injection, it's work ok, but is there a way to use property injection in Nancy Module(TinyIoC, Autofac doesn't matter)?

Steven
  • 166,672
  • 24
  • 332
  • 435
Slava Bobik
  • 31
  • 1
  • 2
  • Why do you want to use property injection? Using constructor injection is bad practice because property injection leads to [temporal coupling](http://blog.ploeh.dk/2011/05/24/DesignSmellTemporalCoupling/). – Steven Nov 05 '15 at 12:10
  • I know about code smell and ect. @Steven, thanks, but I need to use property injection. – Slava Bobik Nov 05 '15 at 13:40
  • But why do you need property injection? – Steven Nov 05 '15 at 13:50

0 Answers0