This are my models:
public class Object
{
[JsonProperty(PropertyName = "test1")]
public string Test1 { get; set; }
[JsonProperty(PropertyName = "test2")]
public string Test2 { get; set; }
[JsonProperty(PropertyName = "_id")]
public ID Id { get; set; }
}
public class ID
{
[JsonProperty(PropertyName = "$id")]
public string Id { get; set; }
}
When I debug it show every value correctly, but after the JsonConvert. Id is empty. What am I doing wrong here?
Json body:
"test1: "sometext",
"test2": "sometext",
"_id": {
"$id": "thisisanidstring"
}