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:
13
Oqtane.Shared/Interfaces/IDatabase.cs
Normal file
13
Oqtane.Shared/Interfaces/IDatabase.cs
Normal 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);
|
||||
}
|
||||
}
|
9
Oqtane.Shared/Models/Database.cs
Normal file
9
Oqtane.Shared/Models/Database.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace Oqtane.Models
|
||||
{
|
||||
public class Database
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Type { get; set; }
|
||||
}
|
||||
}
|
@ -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" />
|
||||
|
Reference in New Issue
Block a user