skip to Main Content

Json – Deserializing private members

I have the following code, taken from https://learn.microsoft.com/En-Us/dotnet/standard/serialization/system-text-json/custom-contracts#example-serialize-private-fields. It works fine to serialize the fields of Brains.Brain, but when deserializing, the instance created has (a, b, c, d) = (2, 0, 4, 4) when it should be (2, 3, 4,…

VIEW QUESTION
Back To Top
Search