I have this json
{
"Message": "The request is invalid.",
"ModelState": {
"UserExists": [
"userName already exists in db."
]
}
}
I can trying to loop through all the model state errors(in this case only 1 but there could be more)
but I can't figure out how to get the text out.
JObject o = JObject.Parse(response.Content);
var errors = o["ModelState"];
foreach (var error in errors)
{
}