Spot the bug in the record cache key

from Records
C# 14 / .NET 10 intermediate 4 min 1 issue to find

Find why lookup of the inserted record key is no longer reliable.

csharp
using System;
using System.Collections.Generic;

SearchKey key = new("shoes") { Page = 1 };
Dictionary<SearchKey, string> cache = new()
{
    [key] = "result"
};

key.Page = 2;
Console.WriteLine(cache.ContainsKey(key));

public sealed record SearchKey(string Query)
{
    public int Page { get; set; }
}
Open in playground
Report an error