I want to map an object to a different property name when deserializing with Newonsoft Json. I have found the answer both here on SO and in their official documentation to use [JsonProperty("name")]
but when I use this code I get the following error:
Constructor 'JsonPropertyAttribute' has 0 parameter(s) but is invoked with 1 argument(s)
What am I doing wrong? I can build the project but I can't get rid of the red squiggly line.
public class Test
{
[JsonProperty("name")]
public string TestName { get; set; }
}