I use c# and Newtonsoft.Json library for serialization and deserialization of json.
I have a class like this
public class Animal
{
[JsonProperty(PropertyName = "Dog")]
public Key value {get;set;}
}
if i instantiate it as
Animal a = new Animal{ Key = "bobby" };
and i serialize it i'll have a json like
{
"dog": "bobby"
}
can i change the PropertyName of the serialization dynamically? for instance, what if i want to put "Bird" or "Cat" instead of "Dog"?