diff --git a/src/EFCore.Relational/Query/Internal/RelationalCommandCache.cs b/src/EFCore.Relational/Query/Internal/RelationalCommandCache.cs index d0c18bb5afd..143b19761a6 100644 --- a/src/EFCore.Relational/Query/Internal/RelationalCommandCache.cs +++ b/src/EFCore.Relational/Query/Internal/RelationalCommandCache.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Concurrent; +using System.Runtime.CompilerServices; using Microsoft.Extensions.Caching.Memory; namespace Microsoft.EntityFrameworkCore.Query.Internal; @@ -154,6 +155,6 @@ public bool Equals(CommandCacheKey commandCacheKey) } public override int GetHashCode() - => 0; + => RuntimeHelpers.GetHashCode(_queryExpression); } }