This is probably obviously but I can't see the problem.
Below is my code and JSON. Can anyone point me in the right direction?
The response from RestSharp is throwing the error:
Unable to cast object of type 'RestSharp.JsonArray' to type 'System.Collections.Generic.IDictionary`2[System.String,System.Object]'.
Is it because the Tags on the first JSON data is null?
**Code**
var client = new RestClient(this.Context.Request.Url.ToString());
var request = new RestRequest("SugarTown/Posts", Method.GET);
request.AddHeader("Accept", "application/json");
var response2 = client.Execute<List<Post>>(request);
**JSON**
[
{
"Id": "posts/1",
"Title": "testes jkl",
"DateCreated": "/Date(-59011459200000)/",
"Body": "<p><strong>sccsdc</strong></p>",
"Tags": null
},
{
"Id": "posts/33",
"Title": "yeah baby",
"DateCreated": "/Date(-59011459200000)/",
"Body": "<p><span style=\"text-decoration: underline;\"><strong>jkljk jklj lkjkl kj </strong></span></p>\r\n<ol>\r\n<li><strong><span style=\"text-decoration: underline;\">,lk</span></strong></li>\r\n<li><strong><span style=\"text-decoration: underline;\">98</span></strong></li>\r\n</ol>",
"Tags": [
"asd",
"qwe",
"fgh",
"jh"
]
}
]
**Model**
public class Post
{
public string Id { get; set; }
public string Title { get; set; }
public DateTime DateCreated { get; set; }
public string Body { get; set; }
public Collection<string> Tags { get; set; }
}