- 画蛇添下足 #1627

This commit is contained in:
2881099 2023-09-27 21:55:55 +08:00
parent 66f7c659ea
commit 18d610cffb

View File

@ -24,17 +24,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 = new ConcurrentDictionary<DataType, ConcurrentDictionary<Type, TableInfo>>(); 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 => ChacheTableEntityFactory?.Invoke() ?? __cacheGetTableByEntity;
{
get
{
if (ChacheTableEntityFactory != null)
{
return ChacheTableEntityFactory.Invoke();
}
return __cacheGetTableByEntity;
}
}
internal static void RemoveTableByEntity(Type entity, CommonUtils common) internal static void RemoveTableByEntity(Type entity, CommonUtils common)
{ {
if (entity.IsAnonymousType() || if (entity.IsAnonymousType() ||