Fix Startup.cs to enable running test on non-Windows OSes
This commit is contained in:
parent
705769bda6
commit
a2f5fcbd2d
|
|
@ -48,9 +48,7 @@ namespace MusicStore
|
||||||
services.Configure<AppSettings>(Configuration.GetSection("AppSettings"));
|
services.Configure<AppSettings>(Configuration.GetSection("AppSettings"));
|
||||||
|
|
||||||
//Sql client not available on mono
|
//Sql client not available on mono
|
||||||
var useInMemoryStore = Configuration["UseInMemoryStore"] == "true" ?
|
var useInMemoryStore = !_runtimeEnvironment.OperatingSystem.Equals("Windows", StringComparison.OrdinalIgnoreCase);
|
||||||
true :
|
|
||||||
_runtimeEnvironment.RuntimeType.Equals("Mono", StringComparison.OrdinalIgnoreCase);
|
|
||||||
|
|
||||||
// Add EF services to the services container
|
// Add EF services to the services container
|
||||||
if (useInMemoryStore)
|
if (useInMemoryStore)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue