修复低版本兼容性

This commit is contained in:
hyzx86 2023-09-27 01:22:37 +08:00
parent be5b2cc044
commit a278578daf
2 changed files with 14 additions and 2 deletions

View File

@ -1445,6 +1445,14 @@
<param name="providerType">提供者的类型,一般不需要指定,如果一直提示“缺少 FreeSql 数据库实现包FreeSql.Provider.MySql.dll可前往 nuget 下载”的错误,说明反射获取不到类型,此时该参数可排上用场<para></para>例如typeof(FreeSql.SqlServer.SqlServerProvider&lt;&gt;)</param> <param name="providerType">提供者的类型,一般不需要指定,如果一直提示“缺少 FreeSql 数据库实现包FreeSql.Provider.MySql.dll可前往 nuget 下载”的错误,说明反射获取不到类型,此时该参数可排上用场<para></para>例如typeof(FreeSql.SqlServer.SqlServerProvider&lt;&gt;)</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:FreeSql.FreeSqlBuilder.UseCustomTableEntityCacheFactory(System.Func{System.Collections.Concurrent.ConcurrentDictionary{FreeSql.DataType,System.Collections.Concurrent.ConcurrentDictionary{System.Type,FreeSql.Internal.Model.TableInfo}}})">
<summary>
用于指定自定义实现TableEntiy 的缓存集合
解决多实例下相同类型映射到不同表的问题
</summary>
<param name="factory"></param>
<returns></returns>
</member>
<member name="M:FreeSql.FreeSqlBuilder.UseAdoConnectionPool(System.Boolean)"> <member name="M:FreeSql.FreeSqlBuilder.UseAdoConnectionPool(System.Boolean)">
<summary> <summary>
使用原始连接池ado.net、odbc、oledb<para></para> 使用原始连接池ado.net、odbc、oledb<para></para>
@ -5002,6 +5010,11 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="F:FreeSql.Internal.Utils.ChacheTableEntityFactory">
<summary>
用于解决多实例情况下的静态集合缓存问题
</summary>
</member>
<member name="T:FreeSql.CoreStrings"> <member name="T:FreeSql.CoreStrings">
<summary> <summary>
<para> <para>

View File

@ -23,7 +23,7 @@ namespace FreeSql.Internal
/// 用于解决多实例情况下的静态集合缓存问题 /// 用于解决多实例情况下的静态集合缓存问题
/// </summary> /// </summary>
public static Func<ConcurrentDictionary<DataType, ConcurrentDictionary<Type, TableInfo>>> ChacheTableEntityFactory = null; public static Func<ConcurrentDictionary<DataType, ConcurrentDictionary<Type, TableInfo>>> ChacheTableEntityFactory = null;
private static ConcurrentDictionary<DataType, ConcurrentDictionary<Type, TableInfo>> __cacheGetTableByEntity; private static ConcurrentDictionary<DataType, ConcurrentDictionary<Type, TableInfo>> __cacheGetTableByEntity = new ConcurrentDictionary<DataType, ConcurrentDictionary<Type, TableInfo>>();
public static ConcurrentDictionary<DataType, ConcurrentDictionary<Type, TableInfo>> _cacheGetTableByEntity public static ConcurrentDictionary<DataType, ConcurrentDictionary<Type, TableInfo>> _cacheGetTableByEntity
{ {
get get
@ -32,7 +32,6 @@ namespace FreeSql.Internal
{ {
return ChacheTableEntityFactory.Invoke(); return ChacheTableEntityFactory.Invoke();
} }
__cacheGetTableByEntity ??= new ConcurrentDictionary<DataType, ConcurrentDictionary<Type, TableInfo>>();
return __cacheGetTableByEntity; return __cacheGetTableByEntity;
} }
} }