I have the following JSON that was obtained after calling JSON.stringify from my javascript
{"parameters":"[{\"ParamName\":\"@s\",\"ParamValue\":\"12\"},{\"ParamName\":\"@t\",\"ParamValue\":\"21\"}]"}
How do i map this to the following model in my ASP.Net MVC2 controller
public class SCVM
{
public string content { get; set; }
public string type { get; set; }
public List<Parameters> parameters { get; set; }
public SCVM()
{
parameters = new List<Parameters>();
}
}
public class Parameters
{
public string ParamName { get; set; }
public string ParamValue { get; set; }
}
I am trying to get this in either a dictionary format or a list objects, but finding difficult to work it out the right way.
JSON.stringify(parametersCollection)',var parametersCollection = [];` and this parametersCollection is an array of the following objectfunction QueryParameters(paramName, paramValue) { this.ParamName = paramName; this.ParamValue = paramValue; }