|
@@ -45,9 +45,15 @@ namespace HyperCube
|
|
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
|
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
|
public void ConfigureServices(IServiceCollection services)
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
{
|
|
|
|
+ string connection;
|
|
|
|
+#if DEBUG
|
|
|
|
+ connection = "DevConnection";
|
|
|
|
+#else
|
|
|
|
+ connection = "ProdConnection";
|
|
|
|
+#endif
|
|
services.AddDbContext<ApplicationDbContext>(options =>
|
|
services.AddDbContext<ApplicationDbContext>(options =>
|
|
options.UseMySQL(
|
|
options.UseMySQL(
|
|
- Configuration.GetConnectionString("DefaultConnection")));
|
|
|
|
|
|
+ Configuration.GetConnectionString(connection)));
|
|
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
|
|
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
|
|
.AddRoles<IdentityRole>()
|
|
.AddRoles<IdentityRole>()
|
|
.AddEntityFrameworkStores<ApplicationDbContext>();
|
|
.AddEntityFrameworkStores<ApplicationDbContext>();
|