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)); }
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)); }