Commit e47eb361 authored by L. Ellenbeck's avatar L. Ellenbeck
Browse files

Fix: singleton now a singleton (coscine/issues#1796)

parent 9fbdf833
......@@ -3,7 +3,6 @@ using Coscine.Database.Settings;
using Coscine.Database.DataModel;
using Coscine.Configuration;
namespace Coscine.Database
{
public partial class CoscineDB : Model
......@@ -12,17 +11,13 @@ namespace Coscine.Database
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
DatabaseSettingsConfiguration databaseSettingsConfiguration;
if (DatabaseSettingsConfiguration == null)
{
IConfiguration _configuration = new ConsulConfiguration();
databaseSettingsConfiguration = new DatabaseSettingsConfiguration(_configuration);
}
else
{
databaseSettingsConfiguration = DatabaseSettingsConfiguration;
DatabaseSettingsConfiguration = new DatabaseSettingsConfiguration(_configuration);
}
optionsBuilder.UseSqlServer(databaseSettingsConfiguration.ConnectionStrings());
optionsBuilder.UseSqlServer(DatabaseSettingsConfiguration.ConnectionStrings());
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment