I'm using C# and the NewtonSoft JSON package.
Lets say I've got an object with a property named "MyProp"
which itself is a class with two properties, "PropA"
and "PropB"
. It by default it serialises like so:
{
"MyProp":
{
"PropA": 1
"PropB": 2
}
}
I want it to serialise like this:
{
"PropA": 1
"PropB": 2
}
Is there anything I can tag "MyProp"
with that will achieve this? Or if I have to write my own JsonConverter
, is there a somewhat painless method of doing this?