I tried like this:
if (result.IsSuccessStatusCode)
{
var content = await result.Content.ReadAsStringAsync();
var content2 = await result2.Content.ReadAsStringAsync();
sVm._matchStatistic = JsonConvert.DeserializeObject<MatchStatisticsModel>(content);
sVm._funModel = JsonConvert.DeserializeObject<FunModel>(content2);
return sVm;
}
but I get an error
Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
After that I will refresh the page the results are coming but, sometimes I get this error and sometimes it comes completely.
public class Fact
{
[JsonProperty("statement")]
public string statement { get; set; }
}
public class FunModel
{
[JsonProperty("generated_at")]
public DateTime generated_at { get; set; }
[JsonProperty("facts")]
public IList<Fact> facts { get; set; }
}
Here is my model and my json
{
"generated_at": "2020-12-06T12:07:02+00:00",
"facts": [
{
"statement": "Yalovaspor bu sezon evinde oynad\u0131\u011f\u0131 ma\u00e7larda: 0-1-4."
},
{
"statement": "Yeni Altindag Belediyespor bu sezon deplasmanda oynad\u0131\u011f\u0131 ma\u00e7larda: 0-1-3."
}
}