diff --git a/src/core/Elsa.Core/Persistence/InMemory/InMemoryStore.cs b/src/core/Elsa.Core/Persistence/InMemory/InMemoryStore.cs index b63ae77af..36f9b4aeb 100644 --- a/src/core/Elsa.Core/Persistence/InMemory/InMemoryStore.cs +++ b/src/core/Elsa.Core/Persistence/InMemory/InMemoryStore.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System.Collections.Concurrent; +using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -95,7 +96,7 @@ namespace Elsa.Persistence.InMemory return dictionary.Values.AsQueryable().FirstOrDefault(specification.ToExpression()); } - private async Task> GetDictionaryAsync() => await MemoryCache.GetOrCreateAsync(CacheKey, _ => Task.FromResult(new Dictionary())); + private async Task> GetDictionaryAsync() => await MemoryCache.GetOrCreateAsync(CacheKey, _ => Task.FromResult(new ConcurrentDictionary())); private void SetDictionary(IDictionary dictionary) => MemoryCache.Set(CacheKey, dictionary); } } \ No newline at end of file