Last active
February 16, 2024 07:10
-
-
Save ycherkes/0f92a01a636407e297443c8db7a802dc to your computer and use it in GitHub Desktop.
Circular reference detection. Why GetHashCode is not valid in this case.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var og = new ObjectIDGenerator(); | |
var a = new { Name = "A" }; | |
var b= new {Name = "A"}; | |
var c = a; | |
var aid = og.GetId(a, out var firstTime); | |
var bid = og.GetId(b, out firstTime); | |
var cid = og.GetId(c, out firstTime); | |
var aHashCode = a.GetHashCode(); | |
var bHashCode = b.GetHashCode(); | |
var cHashCode = c.GetHashCode(); | |
Console.WriteLine("Hello, World!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment