Ejemplo n.º 1
0
        public static void Config()
        {
            var container = new WindsorContainer();

            UomBootstrapper.Config(container);

            var castleActivator = new CastleControllerActivator(container);

            GlobalConfiguration.Configuration
            .Services.Replace(typeof(IHttpControllerActivator), castleActivator);
        }
Ejemplo n.º 2
0
        public static void Config()
        {
            var container = new WindsorContainer();

            UomBootstrapper.Config(container);
            FrameworkBootstrapper.Config(container, "DBConnection");

            var castleActivator = new CastleControllerActivator(container);

            GlobalConfiguration.Configuration.Services.Replace(typeof(IHttpControllerActivator), castleActivator);
            GlobalConfiguration.Configuration.Services.Replace(typeof(IHttpControllerSelector),
                                                               new CqsControllerSelector(GlobalConfiguration.Configuration));
        }
Ejemplo n.º 3
0
        protected void Application_Start()
        {
            // AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            // FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            //  RouteConfig.RegisterRoutes(RouteTable.Routes);
            //  BundleConfig.RegisterBundles(BundleTable.Bundles);

            var container         = new WindsorContainer();
            var aceAFaceRegistrar = new Registrar();

            aceAFaceRegistrar.Setup(container);

            var controllerActivator = new CastleControllerActivator(container);

            GlobalConfiguration.Configuration.Services.Replace(typeof(System.Web.Http.Dispatcher.IHttpControllerActivator), controllerActivator);
            container.Register(
                Classes.
                FromThisAssembly().
                BasedOn <System.Web.Http.Controllers.IHttpController>().    //Web API
                If(c => c.Name.EndsWith("Controller")).
                LifestyleTransient());
        }