From e92c8a1dc4888b3457ab43c610d5867a5279ca05 Mon Sep 17 00:00:00 2001 From: sunkaixuna <610262374@qq.com> Date: Wed, 2 Feb 2022 00:17:03 +0800 Subject: [PATCH] update custom database --- Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs b/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs index 993197b74..30974c68e 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs @@ -410,7 +410,14 @@ namespace SqlSugar { lock (typeCache) { - type = Type.GetType(className + "`" + types.Length, true).MakeGenericType(types); + if (string.IsNullOrEmpty(CustomTypeName)) + { + type = Type.GetType(className + "`" + types.Length, true).MakeGenericType(types); + } + else + { + type = GetCustomTypeByClass(className + "`" + types.Length).MakeGenericType(types); + } Check.ArgumentNullException(type, string.Format(ErrorMessage.ObjNotExist, className)); if (!typeCache.ContainsKey(cacheKey)) {