Whenever it comes to this line, this error appears:
using (var client = new HttpClient())
{
var json = await client.GetStringAsync("http://mvalivros.azurewebsites.net/api/livros");
var livros = JsonConvert.DeserializeObject<List<Model.Livro>>(json);
return livros;
}
A new tab appears in VS that says "Frame not in module."
It happens whenever the thread arrives at the using
line.
This is code complete...
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace LivrosApp.ApiLivros
{
public static class Api
{
public static async Task<IList<Model.Livro>> GetAsync()
{
using (var client = new HttpClient())
{
var json = await client.GetStringAsync("http://mvalivros.azurewebsites.net/api/livros");
var livros = JsonConvert.DeserializeObject<List<Model.Livro>>(json);
return livros;
}
}
}
}