fix DbType
This commit is contained in:
@@ -24,7 +24,7 @@ public class SqlSugarPack : BaseAppPack
|
||||
ConfigId = "face",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:FaceConnectionString").Value,
|
||||
DbType = DbType.MySql,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
@@ -38,7 +38,7 @@ public class SqlSugarPack : BaseAppPack
|
||||
ConfigId = "log",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:LogConnectionString").Value,
|
||||
DbType = DbType.MySql,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Common.Packs
|
||||
{
|
||||
@@ -9,7 +10,28 @@ namespace Dlhis.Common.Packs
|
||||
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSqlSugar();
|
||||
services.AddSqlSugar(sp =>
|
||||
{
|
||||
var configuration = sp.GetService<IConfiguration>();
|
||||
|
||||
return new List<ConnectionConfig>
|
||||
{
|
||||
new()
|
||||
{
|
||||
ConfigId = "log",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:LogConnectionString").Value,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
MoreSettings = new ConnMoreSettings
|
||||
{
|
||||
DisableNvarchar = true,
|
||||
}
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public class SqlSugarPack : BaseAppPack
|
||||
ConfigId = "identity",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:IdentityConnectionString").Value,
|
||||
DbType = DbType.MySql,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SqlSugarPack : BaseAppPack
|
||||
ConfigId = "log",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:LogConnectionString").Value,
|
||||
DbType = DbType.MySql,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class SqlSugarPack : BaseAppPack
|
||||
ConfigId = "identity",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:IdentityConnectionString").Value,
|
||||
DbType = DbType.MySql,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SqlSugarPack : BaseAppPack
|
||||
ConfigId = "default",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:DefaultConnectionString").Value,
|
||||
DbType = DbType.MySql,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user