测试兼容mysql
This commit is contained in:
parent
d4ed14d313
commit
b9cef41cc2
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Falcon.Extend" Version="1.2.1" />
|
<PackageReference Include="Falcon.Extend" Version="1.2.1" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.3" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" />
|
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="3.1.3" />
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="3.1.3" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.3" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.3" />
|
||||||
|
|
|
@ -40,17 +40,18 @@ namespace FAuth
|
||||||
//注册数据库
|
//注册数据库
|
||||||
services.AddDbContext<FAuthDb>(option => {
|
services.AddDbContext<FAuthDb>(option => {
|
||||||
//option.UseSqlServer(this.Configuration.GetValue<string>("Database:FAuthDbSqlServer"));
|
//option.UseSqlServer(this.Configuration.GetValue<string>("Database:FAuthDbSqlServer"));
|
||||||
var dbType = this.Configuration.GetValue<string>("Database:UseDb").ToLower();
|
option.UseMySQL(this.Configuration.GetValue<string>("Database:FAuthDbMySql"));
|
||||||
switch(dbType) {
|
//var dbType = this.Configuration.GetValue<string>("Database:UseDb").ToLower();
|
||||||
case "mysql":
|
//switch(dbType) {
|
||||||
option.UseMySQL(this.Configuration.GetValue<string>("Database:FAuthDbMySql"));
|
// case "mysql":
|
||||||
break;
|
// option.UseMySQL(this.Configuration.GetValue<string>("Database:FAuthDbMySql"));
|
||||||
case "sqlserver":
|
// break;
|
||||||
option.UseSqlServer(this.Configuration.GetValue<string>("Database:FAuthDbSqlServer"));
|
// case "sqlserver":
|
||||||
break;
|
// option.UseSqlServer(this.Configuration.GetValue<string>("Database:FAuthDbSqlServer"));
|
||||||
default:
|
// break;
|
||||||
throw new Exception("Database:UseDbÅäÖôíÎó£¡Ö»ÄÜΪmysql»òsqlserver");
|
// default:
|
||||||
}
|
// throw new Exception("Database:UseDbÅäÖôíÎó£¡Ö»ÄÜΪmysql»òsqlserver");
|
||||||
|
//}
|
||||||
});
|
});
|
||||||
services.AddAccountHelper();
|
services.AddAccountHelper();
|
||||||
//注册Redis
|
//注册Redis
|
||||||
|
|
Loading…
Reference in New Issue
Block a user