I have created a .net core console app to play around and explore UnitsNet. In this app I have a class Person and instantiate it, populate it and use Json.NET to serialise that object before printing it out to the console.
My issue is that the JSON output includes a lot more properties than what I have in my Person class.
Dotnet Fiddle example
Ideally my JSON output would be similar to the below example instead of whats output by the Fiddle linked above.
{
"Acceleration": {
"Value": 12.0,
"Unit": 3,
}
},
"Age": 42,
"BodyMass": {
"StonePounds": {
"Stone": 12.0,
"Pounds": 5.0
},
},
"Height": {
"FeetInches": {
"Feet": 5.0,
"Inches": 10.0
},
},
"Name": "Davey Jones",
"TopSpeed": {
"MilesPerHour": 7.0,
}
}
There is a UnitsNet.Serialization.Json package available, but I'm not sure if the answer is in there, Json.NET or somewhere else.
Any pointers in the right direction would be much appreciated, and as this is my 1st Stack Overflow question any feedback regarding the post itself would be cool as well.