Using c# 4.8, I need to convert the following json into a list of objects but get the following exception:
Cannot deserialize the current JSON array ... because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
Even though it parses in a json parser.
[
{
"Isu_Id": "0FC5FA46-34A7-4B69-B63A-1DEFD8951D28",
"Isu_404Url": "http:\\/\\/cmtafr-dev.crocodiledigital.net\\/IssueImagesOriginal\\/0FC5FA46-34A7-4B69-B63A-1DEFD8951D28.jpg"
},
{
"Isu_Id": "DB396D6E-AF70-43D8-B03D-2314AD1F8C9C",
"Isu_404Url": "http:\\/\\/cmtafr-dev.crocodiledigital.net\\/IssueImagesOriginal\\/DB396D6E-AF70-43D8-B03D-2314AD1F8C9C.jpg"
}
]
I thought it might be the escape charectors so tried using the following text but get the same error:
[
{
"Isu_Id": "0FC5FA46-34A7-4B69-B63A-1DEFD8951D28",
"Isu_404Url": "http"
},
{
"Isu_Id": "DB396D6E-AF70-43D8-B03D-2314AD1F8C9C",
"Isu_404Url": "http"
}
]
and this is my c# code:
public class Issue_Image404ModelList
{
public List<Issue_Image404Model> ListOf404Items { get; set; }
}
and the exception occurs on this line:
var items = JsonConvert.DeserializeObject<Issue_Image404ModelList>(requestContent);
Can someone please kindly tell me how to resolve this?