コード例 #1
0
        public static IWindsorContainer RegisterControllers(this IWindsorContainer container, params Type[] controllerTypes)
        {
            foreach (var type in controllerTypes)
            {
                if (ControllerExtensions.IsController(type))
                {
                    container.Register(Component.For(type).Named(type.FullName.ToLower()).LifeStyle.Is(LifestyleType.Transient));
                }
            }

            return(container);
        }
コード例 #2
0
        public static IWindsorContainer RegisterMvcControllers([NotNull] this IWindsorContainer container,
                                                               params Type[] controllerTypes)
        {
            if (container == null)
            {
                throw new ArgumentNullException(nameof(container));
            }
            foreach (var type in controllerTypes)
            {
                if (ControllerExtensions.IsController(type))
                {
                    container.Register(
                        Component.For(type).Named(type.FullName).LifeStyle.Is(LifestyleType.Transient));
                }
            }

            return(container);
        }