Refactoring route resolutions in Setup

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-01-13 10:01:33 -08:00
parent 024317d06f
commit 1cc8a01d89

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Web.Routing; using System.Web.Routing;
using Autofac; using Autofac;
using JetBrains.Annotations; using JetBrains.Annotations;
@@ -95,7 +96,10 @@ namespace Orchard.Setup {
builder.RegisterType<ShapeTemplateBindingStrategy>().As<IShapeTableProvider>().InstancePerLifetimeScope(); builder.RegisterType<ShapeTemplateBindingStrategy>().As<IShapeTableProvider>().InstancePerLifetimeScope();
builder.RegisterType<BasicShapeTemplateHarvester>().As<IShapeTemplateHarvester>().InstancePerLifetimeScope(); builder.RegisterType<BasicShapeTemplateHarvester>().As<IShapeTemplateHarvester>().InstancePerLifetimeScope();
builder.RegisterType<ShapeAttributeBindingStrategy>().As<IShapeTableProvider>().SingleInstance(); builder.Register(context => new ShapeAttributeBindingStrategy(
context.Resolve<IEnumerable<ShapeAttributeOccurrence>>(),
context.Resolve<IComponentContext>(),
context.Resolve<RouteCollection>())).As<IShapeTableProvider>().SingleInstance();
builder.RegisterModule(new ShapeAttributeBindingModule()); builder.RegisterModule(new ShapeAttributeBindingModule());
} }