Esempio n. 1
0
        public ActionResult Delete(int id)
        {
            PersonVM            person   = new PersonVM();
            HttpResponseMessage response = PersonClientAPI.GetResponseFromAPI(id.ToString());

            if (response.IsSuccessStatusCode)
            {
                person = response.Content.ReadAsAsync <PersonVM>().Result;
            }
            return(View(person));
        }
Esempio n. 2
0
        public ActionResult Index()
        {
            IList <PersonVM>    listPersons = new List <PersonVM>();
            HttpResponseMessage response    = PersonClientAPI.GetResponseFromAPI();

            if (response.IsSuccessStatusCode)
            {
                var persons = response.Content.ReadAsAsync <IEnumerable <PersonVM> >().Result;
                listPersons = persons.ToList();
            }
            return(View(listPersons));
        }