From e1ca66bdc4503cca43f73642b50aea91b2a8bdfd Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 27 Feb 2022 00:53:10 +0800 Subject: [PATCH] Update Custom database --- .../SqlSugar/Infrastructure/InstanceFactory.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs b/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs index c733365c3..10490399b 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs @@ -484,7 +484,18 @@ namespace SqlSugar { lock (typeCache) { - type = assembly.GetType(className); + if (string.IsNullOrEmpty(CustomDllName)) + { + type = assembly.GetType(className); + } + else + { + type= GetCustomTypeByClass(className); + if (type == null) + { + type = assembly.GetType(className); + } + } Check.ArgumentNullException(type, string.Format(ErrorMessage.ObjNotExist, className)); if (!typeCache.ContainsKey(className)) {