Is it possible to achieve the following:
I have a class:
public class Customer
{
public Csutomer()
{
}
public string Name { get; set; }
}
and then I instantiate my class:
Customer cust = new Customer();
cust.Name = "Jhon Smith";
string result = JsonConvert.SerializeObject(cust);
and the result will contain:
{"Name":"Jhon Smith"}
What I need is to get the json like this, notice the dot .
before Name .Name
{".Name":"Jhon Smith"}
And after that to parse the Json back to my object.
Declare your property as:
[JsonProperty(".Name")]
public string Name { get; set; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With