Quote:
[JsonProperty("data")]
public List<data> empdata { get; set; } = new List<data>();
According to the samples in your question, neither API returns a property called
data
.
They both have a property called
content
, but it is not a list; it's an object.
Assuming the property names aren't fixed, you could deserialize the first response into a
Dictionary<string, int>
:
class FirstApiResponse
{
[JsonProperty("status")]
public string Status { get; set; }
[JsonProperty("content")]
public Dictionary<string, int> Content { get; set; }
}
The second API response cannot be deserialized into anything, since it uses the same property name for multiple properties in a single object.