I am having a hard time getting a simple json object into a List
var returnedJson = ["applicant", "recruiter", "team"];
NOT WORKING
List<string> list = (List<string>)JsonConvert.DeserializeObject(returnedJson);
How can I parse the json string into a List?
You need to specify List<string>
as the type argument to DeserializeObject
:
var list = JsonConvert.DeserializeObject<List<string>>(returnedJson);
See more on this question at Stackoverflow