Switch DBType to use the fully-qualified type name rather than a simple name

This commit is contained in:
Charles Nurse
2021-05-12 10:22:17 -07:00
parent c926fa0d27
commit 92dd8354ba
15 changed files with 43 additions and 18 deletions

View File

@ -191,7 +191,7 @@ namespace Oqtane.Infrastructure
{
var databases = scope.ServiceProvider.GetServices<IOqtaneDatabase>();
using (var dbc = new DbContext(new DbContextOptionsBuilder().UseOqtaneDatabase(databases.Single(d => d.Name == databaseType), connectionString).Options))
using (var dbc = new DbContext(new DbContextOptionsBuilder().UseOqtaneDatabase(databases.Single(d => d.TypeName == databaseType), connectionString).Options))
{
// create empty database if it does not exist
dbc.Database.EnsureCreated();
@ -596,7 +596,7 @@ namespace Oqtane.Infrastructure
var databaseType = _config.GetSection(SettingKeys.DatabaseSection)[SettingKeys.DatabaseTypeKey];
var connectionString = NormalizeConnectionString(_config.GetConnectionString(SettingKeys.ConnectionStringKey));
return new InstallationContext(databases.Single(d => d.Name == databaseType), connectionString);
return new InstallationContext(databases.Single(d => d.TypeName == databaseType), connectionString);
}
private string GetInstallationConfig(string key, string defaultValue)