Ninject WCF extensions
C# ASP
Clone or download
Latest commit 2f3e377 Oct 29, 2017
Permalink
Failed to load latest commit information.
packages Fix Pull request #23 Mar 20, 2014
src 3.3.0 Oct 29, 2017
.gitignore 3.3.0 Oct 29, 2017
CHANGELOG.md 3.3.0 Oct 29, 2017
LICENSE.txt adding build files Mar 25, 2010
Ninject.Extensions.Wcf.sln 3.3.0 Oct 29, 2017
README.md 3.3.0 Oct 29, 2017
appveyor.yml 3.3.0 Oct 29, 2017

README.md

Ninject.Extensions.Wcf

Build status NuGet Version NuGet Downloads

This extension adds support for dependency injection for WCF services and behaviors.

There are three Ninject ServiceHostFactorys which could be used in IIS host and self host.

  • Ninject.Extensions.Wcf.NinjectServiceHostFactory is used for ordinary services
  • Ninject.Extensions.Wcf.NinjectWebServiceHostFactory is used for REST services
  • Ninject.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.