Skip to content

Commit 852182f

Browse files
Bjarne CALLEWAERTBjarne CALLEWAERT
authored andcommitted
EFHybridCacheProvider inserted wrong initial value in cache when calling GetValue
1 parent a1a44f3 commit 852182f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/EFCoreSecondLevelCacheInterceptor.HybridCache/EFHybridCacheProvider.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Threading.Tasks;
44
using Microsoft.Extensions.Caching.Hybrid;
@@ -63,10 +63,7 @@ public void ClearAllCachedEntries()
6363
ArgumentNullException.ThrowIfNull(cacheKey);
6464

6565
return hybridCache.GetOrCreateAsync<EFCachedData?>(cacheKey.KeyHash, factory
66-
=> ValueTask.FromResult<EFCachedData?>(new EFCachedData
67-
{
68-
IsNull = true
69-
}))
66+
=> ValueTask.FromResult<EFCachedData?>(null))
7067
.Preserve()
7168
.GetAwaiter()
7269
.GetResult();

0 commit comments

Comments
 (0)