PageRenderTime 37ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

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

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