From 64413a6609c3c9acc11992f3a2bba29cbc6994a4 Mon Sep 17 00:00:00 2001 From: "610262374@qq.com" <610262374@qq.com> Date: Fri, 14 Dec 2018 14:30:42 +0800 Subject: [PATCH] Add remove assembly cache --- .../SqlSeverTest/SqlSugar/Infrastructure/ContextMethods.cs | 1 + .../SqlSeverTest/SqlSugar/Infrastructure/InstanceFactory.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/ContextMethods.cs index 9d362b713..546785882 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/ContextMethods.cs @@ -334,6 +334,7 @@ namespace SqlSugar public void RemoveCacheAll() { ReflectionInoHelper.RemoveAllCache(); + InstanceFactory.RemoveCache(); } public void RemoveCacheAll() diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/InstanceFactory.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/InstanceFactory.cs index edec2ff9f..3b7b4eb76 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/InstanceFactory.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Infrastructure/InstanceFactory.cs @@ -11,6 +11,12 @@ namespace SqlSugar static Assembly assembly = Assembly.Load(UtilConstants.AssemblyName); static Dictionary typeCache = new Dictionary(); + + public static void RemoveCache() + { + typeCache = new Dictionary(); + } + #region Queryable public static ISugarQueryable GetQueryable(ConnectionConfig currentConnectionConfig) {