public List <Locations> GetLocations() { HttpResponseMessage response = _service.GetResponse(ApiUrl + "/api/Location"); string stringData = response.Content.ReadAsStringAsync().Result; List <Locations> locations = JsonConvert.DeserializeObject <List <Locations> >(stringData); return(locations); }
public UserController(IEISService <Users> service) { this.service = service; HttpResponseMessage response = service.GetResponse(ApiUrl + "/api/User"); string stringData = response.Content.ReadAsStringAsync().Result; Users = JsonConvert.DeserializeObject <List <Users> >(stringData); response = service.GetResponse(ApiUrl + "/api/Employee"); string stringData2 = response.Content.ReadAsStringAsync().Result; Persons = JsonConvert.DeserializeObject <List <Person> >(stringData2); foreach (var p in Users) { foreach (var d in Persons) { if (p.PersonId == d.Id) { p.Person = d; } } } }