I have to deserialize a JSON response(from a wep API) . The problem is that this API returns JSON with dynamic property. Had it been like
{
"employees":
[{
"employeeCode": "ABC",
"cityId": 123
},{
"employeeCode": "DEF",
"cityId": 234
}]
}
it would have been perfect but the response is string and is returned like:
var response = @"{"ABC": 123, "DEF": 234}";
Where the first property is "EmployeeCode" and the second property is "CityId". How can I use JSON.Net to serialize it into the following class?
public class Employees
{
public string employeeCode {get; set;}
public string cityId {get; set;}
}