From a278578daf50b8cbe59be87224e8584a840cab8e Mon Sep 17 00:00:00 2001 From: hyzx86 Date: Wed, 27 Sep 2023 01:22:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=8E=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FreeSql/FreeSql.xml | 13 +++++++++++++ FreeSql/Internal/UtilsExpressionTree.cs | 3 +-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/FreeSql/FreeSql.xml b/FreeSql/FreeSql.xml index 9b5affeb..88245752 100644 --- a/FreeSql/FreeSql.xml +++ b/FreeSql/FreeSql.xml @@ -1445,6 +1445,14 @@ 提供者的类型,一般不需要指定,如果一直提示“缺少 FreeSql 数据库实现包:FreeSql.Provider.MySql.dll,可前往 nuget 下载”的错误,说明反射获取不到类型,此时该参数可排上用场例如:typeof(FreeSql.SqlServer.SqlServerProvider<>) + + + 用于指定自定义实现TableEntiy 的缓存集合 + 解决多实例下相同类型映射到不同表的问题 + + + + 使用原始连接池(ado.net、odbc、oledb) @@ -5002,6 +5010,11 @@ + + + 用于解决多实例情况下的静态集合缓存问题 + + diff --git a/FreeSql/Internal/UtilsExpressionTree.cs b/FreeSql/Internal/UtilsExpressionTree.cs index ebd6d9ea..03155a2e 100644 --- a/FreeSql/Internal/UtilsExpressionTree.cs +++ b/FreeSql/Internal/UtilsExpressionTree.cs @@ -23,7 +23,7 @@ namespace FreeSql.Internal /// 用于解决多实例情况下的静态集合缓存问题 /// public static Func>> ChacheTableEntityFactory = null; - private static ConcurrentDictionary> __cacheGetTableByEntity; + private static ConcurrentDictionary> __cacheGetTableByEntity = new ConcurrentDictionary>(); public static ConcurrentDictionary> _cacheGetTableByEntity { get @@ -32,7 +32,6 @@ namespace FreeSql.Internal { return ChacheTableEntityFactory.Invoke(); } - __cacheGetTableByEntity ??= new ConcurrentDictionary>(); return __cacheGetTableByEntity; } }