重构代码:根据最新的Longbow组件调整工程Setup类服务注入代码

This commit is contained in:
Argo-MacBookPro 2018-10-23 20:54:13 +08:00
parent c950fd744d
commit 8f5ee8b373
2 changed files with 4 additions and 4 deletions

View File

@ -44,8 +44,8 @@ namespace Bootstrap.Admin
}); });
services.AddCors(); services.AddCors();
services.AddLogging(builder => builder.AddFileLogger().AddDBLogger(ExceptionsHelper.Log)); services.AddLogging(builder => builder.AddFileLogger().AddDBLogger(ExceptionsHelper.Log));
services.AddConfigurationManager(); services.AddConfigurationManager(Configuration);
services.AddCacheManager(); services.AddCacheManager(Configuration);
services.AddDbAdapter(() => { CacheManager.Clear(); CacheManager.CorsClear(new List<string>() { "*" }); }); services.AddDbAdapter(() => { CacheManager.Clear(); CacheManager.CorsClear(new List<string>() { "*" }); });
var dataProtectionBuilder = services.AddDataProtection(op => op.ApplicationDiscriminator = Configuration["ApplicationDiscriminator"]) var dataProtectionBuilder = services.AddDataProtection(op => op.ApplicationDiscriminator = Configuration["ApplicationDiscriminator"])
.SetApplicationName(Configuration["ApplicationName"]) .SetApplicationName(Configuration["ApplicationName"])

View File

@ -44,8 +44,8 @@ namespace Bootstrap.Client
}); });
services.AddCors(); services.AddCors();
services.AddLogging(builder => builder.AddFileLogger()); services.AddLogging(builder => builder.AddFileLogger());
services.AddConfigurationManager(); services.AddConfigurationManager(Configuration);
services.AddCacheManager(); services.AddCacheManager(Configuration);
services.AddDbAdapter(); services.AddDbAdapter();
var dataProtectionBuilder = services.AddDataProtection(op => op.ApplicationDiscriminator = Configuration["ApplicationDiscriminator"]) var dataProtectionBuilder = services.AddDataProtection(op => op.ApplicationDiscriminator = Configuration["ApplicationDiscriminator"])
.SetApplicationName(Configuration["ApplicationName"]) .SetApplicationName(Configuration["ApplicationName"])