public override void PreInitialize() { //workaround for issue: https://github.com/aspnet/EntityFrameworkCore/issues/9825 //related github issue: https://github.com/aspnet/EntityFrameworkCore/issues/10407 AppContext.SetSwitch("Microsoft.EntityFrameworkCore.Issue9825", true); 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); AbpZeroTemplateLocalizationConfigurer.Configure(Configuration.Localization); //Adding feature providers Configuration.Features.Providers.Add <AppFeatureProvider>(); //Adding setting providers Configuration.Settings.Providers.Add <AppSettingProvider>(); //Adding notification providers Configuration.Notifications.Providers.Add <AppNotificationProvider>(); //Enable this line to create a multi-tenant application. Configuration.MultiTenancy.IsEnabled = AbpZeroTemplateConsts.MultiTenancyEnabled; //Enable LDAP authentication (It can be enabled only if MultiTenancy is disabled!) //Configuration.Modules.ZeroLdap().Enable(typeof(AppLdapAuthenticationSource)); //Twilio - Enable this line to activate Twilio SMS integration //Configuration.ReplaceService<ISmsSender,TwilioSmsSender>(); // MailKit configuration Configuration.Modules.AbpMailKit().SecureSocketOption = SecureSocketOptions.Auto; Configuration.ReplaceService <IMailKitSmtpBuilder, AbpZeroTemplateMailKitSmtpBuilder>(DependencyLifeStyle.Transient); //Configure roles AppRoleConfig.Configure(Configuration.Modules.Zero().RoleManagement); if (DebugHelper.IsDebug) { //Disabling email sending in debug mode Configuration.ReplaceService <IEmailSender, NullEmailSender>(DependencyLifeStyle.Transient); } Configuration.ReplaceService(typeof(IEmailSenderConfiguration), () => { Configuration.IocManager.IocContainer.Register( Component.For <IEmailSenderConfiguration, ISmtpEmailSenderConfiguration>() .ImplementedBy <AbpZeroTemplateSmtpEmailSenderConfiguration>() .LifestyleTransient() ); }); Configuration.Caching.Configure(FriendCacheItem.CacheName, cache => { cache.DefaultSlidingExpireTime = TimeSpan.FromMinutes(30); }); }
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); //语言xml文件 AbpZeroTemplateLocalizationConfigurer.Configure(Configuration.Localization); //Adding feature providers Configuration.Features.Providers.Add <AppFeatureProvider>(); //Adding setting providers Configuration.Settings.Providers.Add <AppSettingProvider>(); //Adding notification providers Configuration.Notifications.Providers.Add <AppNotificationProvider>(); //Enable this line to create a multi-tenant application. Configuration.MultiTenancy.IsEnabled = AbpZeroTemplateConsts.MultiTenancyEnabled; //Enable LDAP authentication (It can be enabled only if MultiTenancy is disabled!) //Configuration.Modules.ZeroLdap().Enable(typeof(AppLdapAuthenticationSource)); //Configure roles AppRoleConfig.Configure(Configuration.Modules.Zero().RoleManagement); if (DebugHelper.IsDebug) { //Disabling email sending in debug mode 在调试模式下禁用电子邮件发送 Configuration.ReplaceService <IEmailSender, NullEmailSender>(DependencyLifeStyle.Transient); } //Configuration.ReplaceService 重写服务! Configuration.ReplaceService(typeof(IEmailSenderConfiguration), () => { Configuration.IocManager.IocContainer.Register( Component.For <IEmailSenderConfiguration, ISmtpEmailSenderConfiguration>() .ImplementedBy <AbpZeroTemplateSmtpEmailSenderConfiguration>() .LifestyleTransient() ); }); Configuration.Caching.Configure(FriendCacheItem.CacheName, cache => { cache.DefaultSlidingExpireTime = TimeSpan.FromMinutes(30); }); Configuration.Caching.Configure(PaymentCacheItem.CacheName, cache => { cache.DefaultSlidingExpireTime = TimeSpan.FromMinutes(AbpZeroTemplateConsts.PaymentCacheDurationInMinutes); }); }
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); AbpZeroTemplateLocalizationConfigurer.Configure(Configuration.Localization); //Adding feature providers Configuration.Features.Providers.Add <AppFeatureProvider>(); //Adding setting providers Configuration.Settings.Providers.Add <AppSettingProvider>(); //Adding notification providers Configuration.Notifications.Providers.Add <AppNotificationProvider>(); //Enable this line to create a multi-tenant application. Configuration.MultiTenancy.IsEnabled = false; //Enable LDAP authentication (It can be enabled only if MultiTenancy is disabled!) //Configuration.Modules.ZeroLdap().Enable(typeof(AppLdapAuthenticationSource)); //Configure roles AppRoleConfig.Configure(Configuration.Modules.Zero().RoleManagement); if (DebugHelper.IsDebug) { //Disabling email sending in debug mode IocManager.Register <IEmailSender, NullEmailSender>(DependencyLifeStyle.Transient); } Configuration.ReplaceService <IAbpSession, AspNetZeroAbpSession>(); Configuration.Caching.Configure(FriendCacheItem.CacheName, cache => { cache.DefaultSlidingExpireTime = TimeSpan.FromMinutes(30); }); }