Exemplo n.º 1
0
		protected void Application_Start() {
			var container = new WindsorContainer();
			Saltarelle.CastleWindsor.ContainerFactory.PrepareWindsorContainer(container);

			RegisterSaltarelleCoreServices(container, SaltarelleConfig.GetFromWebConfig());
			container.RegisterPluginsFromAssembly(typeof(CopyrightNodeProcessor).Assembly);
			container.RegisterControlsFromAssembly(typeof(Lesson1Control).Assembly);
			container.RegisterControlsFromAssembly(typeof(Label).Assembly);
			container.Register(AllTypes.FromAssemblyContaining<HomeController>().BasedOn<IController>().WithService.Self().LifestylePerWebRequest());
			container.Register(Component.For<ILesson7Service>().ImplementedBy<DefaultLesson7Provider>());

			RegisterRoutes(RouteTable.Routes);

			DependencyResolver.SetResolver(container.Resolve, s => (object[])container.ResolveAll(s));
		}
Exemplo n.º 2
0
        protected void Application_Start()
        {
            var container = new WindsorContainer();

            Saltarelle.CastleWindsor.ContainerFactory.PrepareWindsorContainer(container);

            RegisterSaltarelleCoreServices(container, SaltarelleConfig.GetFromWebConfig());
            container.RegisterPluginsFromAssembly(typeof(CopyrightNodeProcessor).Assembly);
            container.RegisterControlsFromAssembly(typeof(Lesson1Control).Assembly);
            container.RegisterControlsFromAssembly(typeof(Label).Assembly);
            container.Register(AllTypes.FromAssemblyContaining <HomeController>().BasedOn <IController>().WithService.Self().LifestylePerWebRequest());
            container.Register(Component.For <ILesson7Service>().ImplementedBy <DefaultLesson7Provider>());

            RegisterRoutes(RouteTable.Routes);

            DependencyResolver.SetResolver(container.Resolve, s => (object[])container.ResolveAll(s));
        }