This extension adds support for dependency injection for WCF services and behaviors.
There are three Ninject ServiceHostFactory
s which could be used in IIS host and self host.
Ninject.Extensions.Wcf.NinjectServiceHostFactory
is used for ordinary servicesNinject.Extensions.Wcf.NinjectWebServiceHostFactory
is used for REST servicesNinject.Extensions.Wcf.NinjectDataServiceHostFactory
is used for data services
There is a NinjectBehaviorExtensionElement
which could resolve WCF behaviors with dependencies.
<system.serviceModel>
...
<extensions>
<behaviorExtensions>
<add name="yourBehaviorName"
type="Ninject.Extensions.Wcf.BaseNinjectBehaviorExtensionElement+NinjectBehaviorExtensionElement`1[[YourAssembly.YourBehavior, YourAssembly]], Ninject.Extensions.Wcf" />
</behaviorExtensions>
</extensions>
...
</system.serviceModel>
You can find more details in wiki page.