Tengo estos dos métodos:
public async Task<List<PullRequest>> GetPullRequests(string name, string repoName)
{
var response = await GetHttpClient().GetAsync($"{Host}/repos/{name}/{repoName}/pulls");
return JsonConvert.DeserializeObject<List<PullRequest>>(await response.Content.ReadAsStringAsync());
}
public async Task<List<Repository>> GetRepositories(string name)
{
var response = await GetHttpClient().GetAsync($"{Host}/orgs/{name}/repos");
return JsonConvert.DeserializeObject<List<Repository>>(await response.Content.ReadAsStringAsync());
}
Pero me salta este error cuando intento ejecutarlo:
Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[Evaluator.Model.Repository]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'message', line 1, position 11.
¿Como lo puedo solucionar?