Created
July 22, 2021 17:43
-
-
Save jaredpar/3863113ecabd27345b265bc1d3470f12 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| using System; | |
| using System.Text.Json; | |
| var r1 = new R(42, 13); | |
| var json = JsonSerializer.Serialize(r1); | |
| Console.WriteLine(json); | |
| var r2 = JsonSerializer.Deserialize<R>(json); | |
| Console.WriteLine(r2); | |
| Console.WriteLine(r2.Equals(r1)); | |
| record R(int x, int y); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment