зеркало из https://github.com/aspnet/MusicStore.git
React to aspnet/Configuration #197
This commit is contained in:
Родитель
170bad48c4
Коммит
d298c9206e
|
@ -103,17 +103,17 @@ namespace MusicStore.Models
|
|||
// await roleManager.CreateAsync(new IdentityRole(adminRole));
|
||||
//}
|
||||
|
||||
var user = await userManager.FindByNameAsync(configuration.Get<string>(defaultAdminUserName));
|
||||
var user = await userManager.FindByNameAsync(configuration.Get(defaultAdminUserName));
|
||||
if (user == null)
|
||||
{
|
||||
user = new ApplicationUser { UserName = configuration.Get<string>(defaultAdminUserName) };
|
||||
await userManager.CreateAsync(user, configuration.Get<string>(defaultAdminPassword));
|
||||
user = new ApplicationUser { UserName = configuration.Get(defaultAdminUserName) };
|
||||
await userManager.CreateAsync(user, configuration.Get(defaultAdminPassword));
|
||||
//await userManager.AddToRoleAsync(user, adminRole);
|
||||
await userManager.AddClaimAsync(user, new Claim("ManageStore", "Allowed"));
|
||||
}
|
||||
|
||||
#if TESTING
|
||||
var envPerfLab = configuration.Get<string>("PERF_LAB");
|
||||
var envPerfLab = configuration.Get("PERF_LAB");
|
||||
if (envPerfLab == "true")
|
||||
{
|
||||
for (int i = 0; i < 100; ++i)
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace MusicStore
|
|||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));
|
||||
services.Configure<AppSettings>(Configuration.GetConfigurationSection("AppSettings"));
|
||||
|
||||
var useInMemoryStore = _platform.IsRunningOnMono || _platform.IsRunningOnNanoServer;
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace MusicStore
|
|||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));
|
||||
services.Configure<AppSettings>(Configuration.GetConfigurationSection("AppSettings"));
|
||||
|
||||
// Add EF services to the services container
|
||||
services.AddEntityFramework()
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace MusicStore
|
|||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));
|
||||
services.Configure<AppSettings>(Configuration.GetConfigurationSection("AppSettings"));
|
||||
|
||||
var useInMemoryStore = _platform.IsRunningOnMono || _platform.IsRunningOnNanoServer;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace MusicStore
|
|||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));
|
||||
services.Configure<AppSettings>(Configuration.GetConfigurationSection("AppSettings"));
|
||||
|
||||
//Sql client not available on mono
|
||||
var useInMemoryStore = _runtimeEnvironment.RuntimeType.Equals("Mono", StringComparison.OrdinalIgnoreCase);
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace MusicStore
|
|||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));
|
||||
services.Configure<AppSettings>(Configuration.GetConfigurationSection("AppSettings"));
|
||||
|
||||
//Sql client not available on mono
|
||||
string value;
|
||||
|
|
Загрузка…
Ссылка в новой задаче