I tried to convert an anonymous object into a JSON object today but when I parse the result of the conversion it says the JSON is invalid. I am clueless why it does that. any help would be much appreciated. Cheers!
var s = new
{
displayName = "ppplll",
description = "Self help community for library",
groupTypes = new[] { "Unified" },
mailEnabled = true,
mail = "[email protected]",
mailNickname = "library",
securityEnabled = false
};
JavaScriptSerializer js = new JavaScriptSerializer();
string json = js.Serialize(s);
The json that gets created:
"{\"displayName\":\"ppplll\",\"description\":\"Self help community for library\",\"groupTypes\":[\"Unified\"],\"mailEnabled\":true,\"mail\":\"[email protected]\",\"mailNickname\":\"library\",\"securityEnabled\":false}"