Ejemplo n.º 1
0
        private RemixJob.RootObject GetJobs()
        {
            HttpClient client = new HttpClient();

            RemixJob.RootObject test = new RemixJob.RootObject();
            RemixJob.RootObject test2 = new RemixJob.RootObject();

            test2._links.next.href = @"/api/jobs?page=1";

            /*
            do
            {
            */

                string json = client.GetStringAsync("http://remixjobs.com" + test2._links.next.href).Result;

                try
                {
                    test2 = JsonConvert.DeserializeObject<RemixJob.RootObject>(json);
                }
                catch
                {
                }

                if (test2.jobs.Count > 0)
                {
                    test.jobs.AddRange(test2.jobs);
                    test._links.next.href = test2._links.next.href;
                }
            /*
            } while (test2.jobs.Count > 0);*/

            return test;
        }
Ejemplo n.º 2
0
 public MainViewModel()
 {
     
     _datas = GetJobs();
     Jobs = FormatDatas(_datas);
 }