Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 1.44 KB

README.md

File metadata and controls

36 lines (22 loc) · 1.44 KB

AppVeyor

AppVeyor

dd4t-di-autofac

Autofac 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.Autofac http://www.nuget.org/packages/DD4T.DI.Autofac
  2. Add DD4T.DI.Autofac namespace to your usings;
  3. Call the UseDD4T method on your Autofac Autofac.ContainerBuilder class.
var builder = new ContainerBuilder();
//set all your custom apllication binding here.
builder.UseDD4T();
builder.Build();

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

var builder = new ContainerBuilder();
//set all your custom apllication binding here.
builder.RegisterType<MyCustomPublicationResovler>().As<IPublicationResolver>().SingleInstance();
builder.UseDD4T();
builder.Build();