C# 9 records as strongly-typed ids - Part 3: JSON serialization

added by DotNetKicks
12/7/2020 12:09:15 AM

972 Views

In the previous post in this series, we noticed that the strongly-typed id was serialized to JSON in an unexpected way: { "id": { "value": 1 }, "name": "Apple", "unitPrice": 0.8 } When you think about it, it's not really unexpected: the strongly-typed id is a "complex" object, not a primitive type, so it makes sense that it's serialized as an object.


0 comments