diff --git a/Src/Asp.Net/SqlSugar/Utilities/PropertyCallAdapterProvider.cs b/Src/Asp.Net/SqlSugar/Utilities/PropertyCallAdapterProvider.cs index b6acb8fc1..fd2060d35 100644 --- a/Src/Asp.Net/SqlSugar/Utilities/PropertyCallAdapterProvider.cs +++ b/Src/Asp.Net/SqlSugar/Utilities/PropertyCallAdapterProvider.cs @@ -25,8 +25,8 @@ namespace SqlSugar } public class PropertyCallAdapterProvider { - private static readonly Dictionary> _instances = - new Dictionary>(); + private static readonly System.Collections.Concurrent.ConcurrentDictionary> _instances = + new System.Collections.Concurrent.ConcurrentDictionary>(); public static IPropertyCallAdapter GetInstance(string forPropertyName) { @@ -60,7 +60,7 @@ namespace SqlSugar .CreateInstance(concreteAdapterType, getterInvocation) as IPropertyCallAdapter; - _instances.Add(forPropertyName, instance); + _instances.GetOrAdd(forPropertyName, instance); } return instance;