public static string TestParser(string jsonString) { //JsonMapper.ToJson(jsonString); StringBuilder builder = new StringBuilder(); JsonDemo jsonObj = JsonMapper.ToObject <JsonDemo>(jsonString); for (int i = 0; i < jsonObj.GetSites().Count; i++) { JsonInfo info = jsonObj.GetSites()[i]; builder.Append("name:" + info.Name + "; url:" + info.Url).Append("\n"); } return(builder.ToString()); }
public ActionResult Demo(JsonDemo demo) { var demoBool = demo.Bool; return(Content(demoBool.ToString())); }