Closed Sabbi closed 5 years ago
Thanks for reporting it. It's fixed via #https://github.com/VahidN/EFSecondLevelCache.Core/commit/f37a6b63bbe95c61ba3cb2134bfdc2657d7e0582
Wow, that was fast! Thank you so much!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related problems.
Summary of the issue
Queries are not cached (IsCacheHit is always false) if a variable is used in the query.
Environment
Example code/Steps to reproduce:
Working code:
as expected, on the first call IsCacheHit is false, on subsequent calls it's true
Non-Working code:
on all calls, IsCacheHit is false. Also EFCacheKey.KeyHash changes on every call, as does the Key inside EFCacheKey.Key
Output:
Non-Working output of EFCacheDebugInfo (KeyHash changes with every call):
Working output of EFCacheDebugInfo
Same problem occurs with FirstOrDefault: