React to aspnet/Configuration #197
This commit is contained in:
parent
170bad48c4
commit
d298c9206e
|
|
@ -103,17 +103,17 @@ namespace MusicStore.Models
|
||||||
// await roleManager.CreateAsync(new IdentityRole(adminRole));
|
// 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)
|
if (user == null)
|
||||||
{
|
{
|
||||||
user = new ApplicationUser { UserName = configuration.Get<string>(defaultAdminUserName) };
|
user = new ApplicationUser { UserName = configuration.Get(defaultAdminUserName) };
|
||||||
await userManager.CreateAsync(user, configuration.Get<string>(defaultAdminPassword));
|
await userManager.CreateAsync(user, configuration.Get(defaultAdminPassword));
|
||||||
//await userManager.AddToRoleAsync(user, adminRole);
|
//await userManager.AddToRoleAsync(user, adminRole);
|
||||||
await userManager.AddClaimAsync(user, new Claim("ManageStore", "Allowed"));
|
await userManager.AddClaimAsync(user, new Claim("ManageStore", "Allowed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TESTING
|
#if TESTING
|
||||||
var envPerfLab = configuration.Get<string>("PERF_LAB");
|
var envPerfLab = configuration.Get("PERF_LAB");
|
||||||
if (envPerfLab == "true")
|
if (envPerfLab == "true")
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 100; ++i)
|
for (int i = 0; i < 100; ++i)
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ namespace MusicStore
|
||||||
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));
|
services.Configure<AppSettings>(Configuration.GetConfigurationSection("AppSettings"));
|
||||||
|
|
||||||
var useInMemoryStore = _platform.IsRunningOnMono || _platform.IsRunningOnNanoServer;
|
var useInMemoryStore = _platform.IsRunningOnMono || _platform.IsRunningOnNanoServer;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ namespace MusicStore
|
||||||
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));
|
services.Configure<AppSettings>(Configuration.GetConfigurationSection("AppSettings"));
|
||||||
|
|
||||||
// Add EF services to the services container
|
// Add EF services to the services container
|
||||||
services.AddEntityFramework()
|
services.AddEntityFramework()
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace MusicStore
|
||||||
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));
|
services.Configure<AppSettings>(Configuration.GetConfigurationSection("AppSettings"));
|
||||||
|
|
||||||
var useInMemoryStore = _platform.IsRunningOnMono || _platform.IsRunningOnNanoServer;
|
var useInMemoryStore = _platform.IsRunningOnMono || _platform.IsRunningOnNanoServer;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ namespace MusicStore
|
||||||
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));
|
services.Configure<AppSettings>(Configuration.GetConfigurationSection("AppSettings"));
|
||||||
|
|
||||||
//Sql client not available on mono
|
//Sql client not available on mono
|
||||||
var useInMemoryStore = _runtimeEnvironment.RuntimeType.Equals("Mono", StringComparison.OrdinalIgnoreCase);
|
var useInMemoryStore = _runtimeEnvironment.RuntimeType.Equals("Mono", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ namespace MusicStore
|
||||||
|
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings"));
|
services.Configure<AppSettings>(Configuration.GetConfigurationSection("AppSettings"));
|
||||||
|
|
||||||
//Sql client not available on mono
|
//Sql client not available on mono
|
||||||
string value;
|
string value;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue