I tried using
var myobject = JsonConvert.SerializeObject(Customer);
but problem is in Customer
properties are like
FirstName
and my service expecting json input like firstName
{"firstName":"Neo"}
statement JsonConvert.SerializeObject(Customer);
gives me {"FirstName":"Neo"}
which is wrong.
So How can I change first letter when JsonConvert.SerializeObject happened ?
Or How to take only one parameter as input json firstname
instead if using Customer object.
You should use the Json.NET attribute support to customize the naming:
public class Customer
{
[JsonProperty("firstName")]
public string FirstName { get; set; }
}
See more on this question at Stackoverflow