I have a .Net 4.0 WCF service that I'm trying to setup ninject for. I downloaded the WCF extension for ninject and had a look through the TimeService example. Everything looks simple enough, however I can't see how ninject is doing its job correctly as there is a parameter-less constructor manually injecting the dependency.
public TimeService()
: this(new SystemClock())
{
}
public TimeService( ISystemClock systemClock )
{
_systemClock = systemClock;
}
As far as I understand this code will never use ninject binding. The first constructor will call the second constructor if I don't provide any params. When in testing and I pass in my mock object the second constructor will be called. I'm pretty new to both WCF and ninject so apologies if I am missing anything obvious!
Can anyone explain?
Thanks