diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs b/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs index 42b972df2..ffafae519 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/InstanceFactory.cs @@ -493,9 +493,13 @@ namespace SqlSugar return result; } - private static Type GetCustomTypeByClass(string className) + internal static Type GetCustomTypeByClass(string className) { - Type type = Assembly.LoadFrom(CustomTypeName+".dll").GetType(className); + var key = "Assembly_"+ CustomTypeName+assembly.GetHashCode(); + var newAssembly = new ReflectionInoCacheService().GetOrCreate(key, () => { + return Assembly.LoadFrom(CustomTypeName + ".dll"); + }); + Type type = newAssembly.GetType(className); return type; } #endregion