|
|
|
@ -3,7 +3,6 @@ using Microsoft.AspNetCore.DataProtection; |
|
|
|
using Microsoft.OpenApi.Models; |
|
|
|
using MyCompanyName.MyProjectName.Data; |
|
|
|
using MyCompanyName.MyProjectName.Localization; |
|
|
|
using StackExchange.Redis; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.Account; |
|
|
|
using Volo.Abp.Account.Web; |
|
|
|
@ -19,7 +18,6 @@ using Volo.Abp.AspNetCore.Serilog; |
|
|
|
using Volo.Abp.AuditLogging.EntityFrameworkCore; |
|
|
|
using Volo.Abp.Autofac; |
|
|
|
using Volo.Abp.AutoMapper; |
|
|
|
using Volo.Abp.Caching.StackExchangeRedis; |
|
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
|
using Volo.Abp.EntityFrameworkCore.SqlServer; |
|
|
|
using Volo.Abp.FeatureManagement; |
|
|
|
@ -53,7 +51,6 @@ namespace MyCompanyName.MyProjectName; |
|
|
|
typeof(AbpAspNetCoreMultiTenancyModule), |
|
|
|
typeof(AbpAutofacModule), |
|
|
|
typeof(AbpAutoMapperModule), |
|
|
|
typeof(AbpCachingStackExchangeRedisModule), |
|
|
|
typeof(AbpEntityFrameworkCoreSqlServerModule), |
|
|
|
typeof(AbpAspNetCoreMvcUiBasicThemeModule), |
|
|
|
typeof(AbpSwashbuckleModule), |
|
|
|
@ -126,7 +123,7 @@ public class MyProjectNameModule : AbpModule |
|
|
|
ConfigureLocalization(); |
|
|
|
ConfigureAuthentication(context.Services, configuration); |
|
|
|
ConfigureCors(context, configuration); |
|
|
|
ConfigureDataProtection(context, configuration, hostingEnvironment); |
|
|
|
ConfigureDataProtection(context); |
|
|
|
ConfigureEfCore(context); |
|
|
|
} |
|
|
|
|
|
|
|
@ -278,17 +275,9 @@ public class MyProjectNameModule : AbpModule |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void ConfigureDataProtection( |
|
|
|
ServiceConfigurationContext context, |
|
|
|
IConfiguration configuration, |
|
|
|
IWebHostEnvironment hostingEnvironment) |
|
|
|
private void ConfigureDataProtection(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("MyProjectName"); |
|
|
|
if (!hostingEnvironment.IsDevelopment()) |
|
|
|
{ |
|
|
|
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); |
|
|
|
dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys"); |
|
|
|
} |
|
|
|
context.Services.AddDataProtection().SetApplicationName("MyProjectName"); |
|
|
|
} |
|
|
|
|
|
|
|
private void ConfigureEfCore(ServiceConfigurationContext context) |
|
|
|
|