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.
22 lines
549 B
22 lines
549 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();
|
||
|
}
|
||
|
}
|
||
|
}
|