Beispiel #1
0
        public static void Initialize(TestContext context)
        {
            var configSource = new DaDefaultConfigurationSource();

            DaInitializationManager.AddModuleInitializer(new DaDefaultDataInitializer(configSource));
            DaInitializationManager.AddModuleInitializer(new DaDefaultEnterpriseSecurityInitializer(configSource));
            DaInitializationManager.AddModuleInitializer(new DaDefaultIdentityInitializer(configSource));
            DaInitializationManager.AddModuleInitializer(new DaDefaultMailInitializer(configSource));
            DaInitializationManager.AddModuleInitializer(new DaDefaultSmsInitializer(configSource));

            DaInitializationManager.Execute();

            IdentityDbContext           = new DaIdentityDbContext();
            EnterpriseSecurityDbContext = new DaEnterpriseSecurityDbContext();
            ListsDbContext = new DaListsDbContext();

            IdentityDbContext.Database.CreateIfNotExists();
            EnterpriseSecurityDbContext.Database.CreateIfNotExists();
            ListsDbContext.Database.CreateIfNotExists();

            CreateSystemRoles();
            CreateGlobalSuperAdminUser();

            var userManager = new DaUserManager(new DaUserRepository(IdentityDbContext));
            var user        = userManager.FindByName(DaUser.GLOBAL_SUPER_ADMIN);

            CreateDefaultLists();
            LoadEnterpriseSecurityData(user.Id);
        }
Beispiel #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            var configSource = new DaDefaultConfigurationSource();

            DaInitializationManager.AddModuleInitializer(new DaDefaultDataInitializer(configSource));
            DaInitializationManager.AddModuleInitializer(new DaDefaultAppsInitializer(configSource));
            DaInitializationManager.AddModuleInitializer(new DaDefaultIdentityInitializer(configSource));
            DaInitializationManager.AddModuleInitializer(new DaDefaultMailInitializer(configSource));
            DaInitializationManager.AddModuleInitializer(new DaDefaultSmsInitializer(configSource));

            DaInitializationManager.Execute();
        }