Added IDatabase interface and refactored to use it to handle database type - updated Installer to dynamically add databases to selector

This commit is contained in:
Charles Nurse
2021-03-24 11:45:44 -07:00
parent cbcfc88492
commit 3a032f401a
14 changed files with 145 additions and 36 deletions

View File

@ -0,0 +1,13 @@
using Microsoft.EntityFrameworkCore;
namespace Oqtane.Interfaces
{
public interface IDatabase
{
public string FriendlyName { get; }
public string Name { get; }
public DbContextOptionsBuilder UseDatabase(DbContextOptionsBuilder optionsBuilder, string connectionString);
}
}

View File

@ -0,0 +1,9 @@
namespace Oqtane.Models
{
public class Database
{
public string Name { get; set; }
public string Type { get; set; }
}
}

View File

@ -18,6 +18,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Text.Json" Version="5.0.1" />