Im using NewtonSoft linq 2 json to serialize objects from classes straight to a json string
The class object I'm using is very simple :
public class OverviewQuery
{
public string id { get; set; }
public string method { get; set; }
public string Params { get; set; }
public OverviewQuery(string sid, string smethod, string sparam)
{
this.id = sid;
this.method = smethod;
this.Params = sparam;
}
}
If I serialise this, I get the Json string :
"{\"id\":\"1\",\"method\":\"getStockItemDetails\",\"Params\":\"0000000002\"}"
The Oracle server I'm connecting to (through WebAPI's) requires me to use very very specific naming, here it should be
"{\"id\":\"1\",\"method\":\"getStockItemDetails\",\"Params\":[\"0000000002\"]}"
Is there any way NewtonSoft implemented a way to achieve this formatting ? Without correct formatting, the only way to send the information is through hardcoding everything..