Beispiel #1
0
        public void GetAllControllerForAll()
        {
            var servicePrefix = TestModule.ModuleName.ToCamelCase();
            var serviceName   = servicePrefix + "/" + "TestMvc".ToCamelCase().RemovePostFix(BlocksWebMvcController.Postfixes);;
            IDefaultControllerBuilderFactory factory = new MvcControllerBuilderFactory(LocalIocManager);

            factory.ForAll <BlocksWebMvcController>(servicePrefix, servicesType).Build();

            TestControllerForTestController(serviceName);
        }
        public override void Initialize()
        {
            IocManager.Register <INavigationFilter, MvcNavigationFilter>();
            IocManager.Register <INavigationFilter, FrontNavigationFilter>();
            IocManager.Register <MvcControllerManager>();
            IDefaultControllerBuilderFactory factory = new MvcControllerBuilderFactory(IocManager);
            var servicePrefix = TestModule.ModuleName.ToCamelCase();
            var servicesType  = IocManager.IocContainer.Kernel.GetHandlers().SelectMany(t => t.Services).Where(t => t.Assembly == Assembly.GetExecutingAssembly());

            factory.ForAll <BlocksWebMvcController>(servicePrefix, servicesType).Build();
        }
        public DefaultUserNavigationManagerTest()
        {
            LocalIocManager.Register <IUserNavigationManager, DefaultUserNavigationManager>();
            LocalIocManager.Register <IAuthorizationService, RoleAuthorizationService>();
            LocalIocManager.Register <IUserManager, DefaultUserManager>();

            IDefaultControllerBuilderFactory factory = new MvcControllerBuilderFactory(LocalIocManager);
            var servicePrefix = TestModule.ModuleName.ToCamelCase();
            var servicesType  = LocalIocManager.IocContainer.Kernel.GetHandlers().SelectMany(t => t.Services).Where(t => t.Assembly == Assembly.GetExecutingAssembly());

            factory.ForAll <BlocksWebMvcController>(servicePrefix, servicesType).Build();
        }
        internal void RegisterController()
        {
            var features = _extensionManager.LoadFeaturesAsync().Result;

            foreach (var feature in features)
            {
                _mvcControllerBuilderFactory.ForAll <IAppService>(AreaTemplate.GetAreaKey(new AreaOption()
                {
                    AreaName     = feature.FeatureInfo.Id,
                    FunctionType = "api"
                }), feature.ExportedTypes.Where(IsController)).Build();
            }
        }