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.

34 lines
811 B

2 years ago
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();
}
2 years ago
else if (db == "Oracle")
{
options.UseOracle();
}
else if (db == "PostgreSql")
{
options.UseNpgsql();
}
else if (db == "SQLite")
{
options.UseSqlite();
}
2 years ago
}
}