I'm using the Newtosoft Json.NET library for deserializing API responses to objects. But I need to update already deserialized object with a partial update (e.g. JSON containig with only changed properties).
For example:
I have a person model (of course simplified):
public class PersonModel
{
public string Name { get; set; }
public string Surname{ get; set; }
public int Age { get; set; }
}
and a instance of Person deserialized from JSON data:
{
"name": "John",
"surname": "Newton",
"age": 20
}
Then I get JSON with changes:
{
"age": 21
}
and I need to update my instannce with this JSON (so only age property of my instance will be updated to value 21)
Is there a simple way how to do it?