We have a standard json
format that we defined (the typo is on purpose):
{
"Name" : "John",
"Salari" : "150000"
}
which is de-serialized (using newtonsoft) to:
class Person
{
public string Name;
public string Salari;
}
Is there a way to change Salari
to Salary
and still be able to accept messages with the old name?
Something like:
class Person
{
public string Name;
[DeserializeAlso("Salari")]
public string Salary;
}
To make newtonsoft de-serializer understand that Salari
should be de-serialized to the Salary
field?