dd4t / DD4T.DI.Ninject

Ninject Dependency Injection for DD4T .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AppVeyor

AppVeyor

dd4t-di-ninject

Ninject Dependency injection container

Release 2.5

  • Upgraded reference to DD4T.Core
  • Suppress warnings about obsolete methods in IComponentProvider

How to

  1. Install Nuget package: Install-Package DD4T.DI.Ninject http://www.nuget.org/packages/DD4T.DI.Ninject
  2. Add DD4T.DI.Ninject namespace to your usings;
  3. Call the UseDD4T method on your Ninject Ninject.IKernel interface.
IKernel kernel = new StandardKernel();
//set all your custom apllication binding here.

kernel.UseDD4T();

UseDD4T will Register all default class provided by the DD4T framework.

If you need to override the default classes: (i.e. the DefaultPublicationResovler) Register your class before the method call UseDD4T

IKernel kernel = new StandardKernel();
//set all your custom apllication binding here.
kernel.Bind<IPublicationResolver>().To<MyCustomPublicationResovler>().InSingletonScope();
kernel.UseDD4T();

About

Ninject Dependency Injection for DD4T .NET

License:Apache License 2.0


Languages

Language:C# 100.0%