Ejemplo n.º 1
0
        public override void PreInitialize()
        {
            // 多租户
            Configuration.MultiTenancy.IsEnabled = YoyoCmsTemplateConsts.MultiTenancyEnabled;
            // 使用审计日志
            Configuration.Auditing.IsEnabledForAnonymousUsers = true;


            // 声明类型
            Configuration.Modules.Zero().EntityTypes.Tenant = typeof(Tenant);
            Configuration.Modules.Zero().EntityTypes.Role = typeof(Role);
            Configuration.Modules.Zero().EntityTypes.User = typeof(User);


            // 功能
            Configuration.Features.Providers.Add <AppFeatureProvider>();
            // 设置
            Configuration.Settings.Providers.Add <AppSettingProvider>();

            // 本地化
            YoyoCmsTemplateLocalizationConfigurer.Configure(Configuration.Localization);


            // 启用LDAP身份验证(只有禁用多租户才能启用)
            //Configuration.Modules.ZeroLdap().Enable(typeof(AppLdapAuthenticationSource));

            // 配置角色
            AppRoleConfig.Configure(Configuration.Modules.Zero().RoleManagement);


            // 如果是Debug模式
            if (DebugHelper.IsDebug)
            {
                // 禁用邮件发送
                Configuration.ReplaceService <IEmailSender, NullEmailSender>(DependencyLifeStyle.Transient);
            }


            // 全局缓存配置默认过期时间
            Configuration.Caching.Configure(PaymentCacheItem.CacheName, cache =>
            {
                cache.DefaultSlidingExpireTime = TimeSpan.FromMinutes(YoyoCmsTemplateConsts.PaymentCacheDurationInMinutes);
            });
        }
Ejemplo n.º 2
0
        public override void PreInitialize()
        {
            Configuration.Auditing.IsEnabledForAnonymousUsers = true;

            // Declare entity types
            Configuration.Modules.Zero().EntityTypes.Tenant = typeof(Tenant);
            Configuration.Modules.Zero().EntityTypes.Role = typeof(Role);
            Configuration.Modules.Zero().EntityTypes.User = typeof(User);

            YoyoCmsTemplateLocalizationConfigurer.Configure(Configuration.Localization);

            // Enable this line to create a multi-tenant application.
            Configuration.MultiTenancy.IsEnabled = YoyoCmsTemplateConsts.MultiTenancyEnabled;

            // Configure roles
            AppRoleConfig.Configure(Configuration.Modules.Zero().RoleManagement);

            Configuration.Settings.Providers.Add <AppSettingProvider>();
        }
Ejemplo n.º 3
0
        public override void PreInitialize()
        {
            // 使用审计日志
            Configuration.Auditing.IsEnabledForAnonymousUsers = true;


            // 声明类型
            Configuration.Modules.Zero().EntityTypes.Tenant = typeof(Tenant);
            Configuration.Modules.Zero().EntityTypes.Role = typeof(Role);
            Configuration.Modules.Zero().EntityTypes.User = typeof(User);


            // 功能
            Configuration.Features.Providers.Add <AppFeatureProvider>();
            // 设置
            Configuration.Settings.Providers.Add <AppSettingProvider>();

            // 本地化
            YoyoCmsTemplateLocalizationConfigurer.Configure(Configuration.Localization);


            // 启用LDAP身份验证(只有禁用多租户才能启用)
            //Configuration.Modules.ZeroLdap().Enable(typeof(AppLdapAuthenticationSource));

            // 配置角色
            AppRoleConfig.Configure(Configuration.Modules.Zero().RoleManagement);


            // 如果是Debug模式// 禁用邮件发送


            Configuration.ReplaceService <IMailKitSmtpBuilder, YoYoMailKitSmtpBuilder>();



            // 全局缓存配置默认过期时间
            //Configuration.Caching.Configure(PaymentCacheItem.CacheName, cache =>
            //{
            //    cache.DefaultSlidingExpireTime = TimeSpan.FromMinutes(AppConsts.PaymentCacheDurationInMinutes);
            //});
        }