diff --git a/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs b/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs index e995a0a6e..a9236cd6d 100644 --- a/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs +++ b/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs @@ -670,17 +670,32 @@ namespace SqlSugar } return type; } - internal static Type GetCustomTypeByClass(string className) { - var key = "Assembly_" + CustomDllName + assembly.GetHashCode(); + Type type = null; + foreach (var item in CustomDlls.AsEnumerable()) + { + if (type == null) + { + type = GetCustomTypeByClass(className, item); + } + if (type != null) + { + break; + } + } + return type; + } + internal static Type GetCustomTypeByClass(string className,string customDllName) + { + var key = "Assembly_" + customDllName + assembly.GetHashCode(); var newAssembly = new ReflectionInoCacheService().GetOrCreate(key, () => { try { var path = Assembly.GetExecutingAssembly().Location; if (path.HasValue()) { - path = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(path), CustomDllName + ".dll"); + path = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(path), customDllName + ".dll"); } if (path.HasValue() && FileHelper.IsExistFile(path)) {