0

I have the following code and i need to use it inside a List<>. Can someone help me on this?

    protected void Page_Load(object sender, EventArgs e)
    {

        string url = "http://localhost:52148/api/federateds";

        using (var w = new WebClient())
        {
            var json_data = string.Empty;
            try
            {
                json_data = w.DownloadString(url);
            }
            catch (Exception) { }
        }

        List<federateds> federados = new ????;

    }
trashgod
  • 203,806
  • 29
  • 246
  • 1,045

1 Answers1

0

You should try JSON frameworks, like Json.NET

With it your code would look like

List<federateds> federados = JsonConvert.DeserializeObject<List<federateds>>(json_data);
Toddams
  • 1,489
  • 15
  • 23