You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
811 B
33 lines
811 B
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Volo.Abp.EntityFrameworkCore;
|
|
|
|
namespace Win_in.Sfs.Shared.Host;
|
|
|
|
public static class AbpDbContextOptionsExtensions
|
|
{
|
|
public static void UseDatabase(this AbpDbContextOptions options, IConfiguration configuration)
|
|
{
|
|
var db = configuration.GetValue("Database", "MySQL");
|
|
if (db == "MySQL")
|
|
{
|
|
options.UseMySQL();
|
|
}
|
|
else if (db == "SQLServer")
|
|
{
|
|
options.UseSqlServer();
|
|
}
|
|
else if (db == "Oracle")
|
|
{
|
|
options.UseOracle();
|
|
}
|
|
else if (db == "PostgreSql")
|
|
{
|
|
options.UseNpgsql();
|
|
}
|
|
else if (db == "SQLite")
|
|
{
|
|
options.UseSqlite();
|
|
}
|
|
}
|
|
}
|
|
|