PageRenderTime 16ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/src/MM.Bootstrapper/Configurators/ControllerConfigurator.cs

#
C# | 27 lines | 22 code | 5 blank | 0 comment | 0 complexity | 35e9b0bedaca4b555cecde186f4fbee1 MD5 | raw file
 1using Castle.Windsor;
 2using Castle.MicroKernel.Registration;
 3using MM.Web.Controllers;
 4using System.Reflection;
 5using System.Web.Mvc;
 6
 7namespace MM.Bootstrapper.Configurators
 8{
 9    public class ControllerConfigurator : IConfigurator
10    {
11        #region Miembros de IConfigurator
12
13        public void Configure(IWindsorContainer container)
14        {
15            ControllerBuilder.Current.SetControllerFactory(new WindsorControllerFactory(container));
16
17            container.Register(
18               AllTypes.Of<ICustomerController>()
19               .FromAssembly(typeof(ICustomerController).Assembly)
20               .Configure(cf => cf.LifeStyle.Transient)
21               );
22        }
23
24
25        #endregion
26    }
27}