When I make an API call I get the following response
{
"AdPlanId": 1,
"PlanName": "SWIFT Test plan",
"Description": "Descritpion for Test plan",
"NoVideosToPlay": 2,
"NoBannersToShow": 3,
"MinTimeBetweenAds": 5,
"MaxTimeBetwenAds": 15,
"MinDataConsumption": 25,
"MaxDataConsumption": 100,
"Created": "2017-01-24T16:35:13.042211",
"LastModified": "2017-01-24T16:35:13.042712",
"MarkedForDeletion": null,
"MarkedDeletedDate": null
}
which I then try to Deserialize using the C# code
var response = await client.GetAsync(uri);
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
return new DBResult<T>(true, JsonConvert.DeserializeObject<T>(content));
}
I get a "Null object cannot be converted to a value type" exception in this line return new DBResult(true, JsonConvert.DeserializeObject(content)); Please what I'm I doing wrong?