From 275468dc40318f719cfe87b37136cf12250d27b2 Mon Sep 17 00:00:00 2001 From: sunkaixuna <610262374@qq.com> Date: Tue, 1 Feb 2022 16:17:03 +0800 Subject: [PATCH] Update Custom db --- .../SqlSugar/Abstract/SugarProvider/SqlSugarAccessory.cs | 3 ++- Src/Asp.Net/SqlSugar/Entities/ConnMoreSettings.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/SugarProvider/SqlSugarAccessory.cs b/Src/Asp.Net/SqlSugar/Abstract/SugarProvider/SqlSugarAccessory.cs index b6060c1e4..73466e287 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SugarProvider/SqlSugarAccessory.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SugarProvider/SqlSugarAccessory.cs @@ -388,7 +388,8 @@ namespace SqlSugar InstanceFactory.CustomTypeName = SugarCompatible.IsFramework?"SqlSugar.Access": "SqlSugar.AccessCore"; break; case DbType.Custom: - InstanceFactory.CustomTypeName = "Custom"; + Check.Exception(config?.MoreSettings?.CustomNugetDllName == null,ErrorMessage.GetThrowMessage("if DbType is Custmon , ConnectionConfig.MoreSettings.CustomNugetDbName is not null", "DbType是Custom ,而需要设置外部数据库支持dll名称。示例: ConnectionConfig.MoreSettings.CustomNugetDllName=\"SqlSugar.DB2\" , 设置完后我们需要引用SqlSugar.DB2.dll ")); + InstanceFactory.CustomTypeName = config.MoreSettings.CustomNugetDllName; break; default: throw new Exception("ConnectionConfig.DbType is null"); diff --git a/Src/Asp.Net/SqlSugar/Entities/ConnMoreSettings.cs b/Src/Asp.Net/SqlSugar/Entities/ConnMoreSettings.cs index 6a0b0d0e2..bdab95bf4 100644 --- a/Src/Asp.Net/SqlSugar/Entities/ConnMoreSettings.cs +++ b/Src/Asp.Net/SqlSugar/Entities/ConnMoreSettings.cs @@ -14,5 +14,6 @@ namespace SqlSugar public bool PgSqlIsAutoToLower = true; public int DefaultCacheDurationInSeconds { get; set; } public bool? TableEnumIsString { get; set; } + public string CustomNugetDllName { get; set; } } }