class Program
{
static void Main(string[] args)
{
new Wtf { Foo = "FOO" }.GetHashCode();
}
private struct Wtf
{
public string Foo { get; set; }
public override int GetHashCode() => new { A = Foo }.GetHashCode();
}
}
如果我在此设置断点new { A = Foo }.GetHashCode()
并打开快速监视窗口,则以下表达式会产生不同的结果:
new { A = Foo }.GetHashCode()
this.GetHashCode()
我做错了什么?