More autofac

pull/21/head
Mark McDowall 12 years ago
parent 924d3d0c8e
commit c4e886a8f8

@ -25,7 +25,7 @@ namespace NzbDrone.Core.Test
{ {
InitLogging(); InitLogging();
var dispatch = new CentralDispatch(); var dispatch = new CentralDispatch();
kernel = dispatch.Build(); kernel = dispatch.BuildContainer();
WebTimer.Stop(); WebTimer.Stop();
} }

@ -165,7 +165,7 @@ namespace NzbDrone.Core
} }
} }
public IContainer Build() public IContainer BuildContainer()
{ {
var container = ContainerBuilder.Build(); var container = ContainerBuilder.Build();

@ -75,7 +75,7 @@ namespace NzbDrone.Web
MVCRegistration(dispatch.ContainerBuilder); MVCRegistration(dispatch.ContainerBuilder);
var container = dispatch.ContainerBuilder.Build(); var container = dispatch.BuildContainer();
DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); DependencyResolver.SetResolver(new AutofacDependencyResolver(container));

@ -29,6 +29,7 @@ namespace NzbDrone
private static void BindKernel(ContainerBuilder builder) private static void BindKernel(ContainerBuilder builder)
{ {
builder.RegisterAssemblyTypes(typeof(DiskProvider).Assembly).SingleInstance(); builder.RegisterAssemblyTypes(typeof(DiskProvider).Assembly).SingleInstance();
builder.RegisterType<Router>();
builder.RegisterType<ApplicationServer>().SingleInstance(); builder.RegisterType<ApplicationServer>().SingleInstance();
builder.RegisterType<ConfigFileProvider>().SingleInstance(); builder.RegisterType<ConfigFileProvider>().SingleInstance();

Loading…
Cancel
Save