14
Mengapa penting untuk mengganti GetHashCode ketika metode Equals diganti?
Diberi kelas berikut public class Foo { public int FooId { get; set; } public string FooName { get; set; } public override bool Equals(object obj) { Foo fooItem = obj as Foo; if (fooItem == null) { return false; } return fooItem.FooId == this.FooId; } public override int GetHashCode() …
1445
c#
overriding
hashcode