添加其他数据库

This commit is contained in:
2024-07-18 08:40:24 +08:00
parent e16a2dfe37
commit d8a9562ffa
4 changed files with 127 additions and 1 deletions

View File

@@ -33,6 +33,26 @@ public static class ConfigureSqlSugarExtensions
},
});
foreach (var item in conn.ConfigList)
{
connectConfigList.Add(new ConnectionConfig
{
ConnectionString = item.connectionStr,
DbType = item.dbType,
IsAutoCloseConnection = true,
ConfigId = item.ServiceName,
InitKeyType = InitKeyType.Attribute,
MoreSettings = new ConnMoreSettings()
{
IsAutoRemoveDataCache = true, // 自动清理缓存
IsAutoToUpper = false,
//PgSqlIsAutoToLower = false,
DisableNvarchar = true
},
});
}
services.AddSqlSugar(connectConfigList, client =>
{
//connectConfigList.ForEach(config =>