Esempio n. 1
0
        public static City GetDetails(int id)
        {
            var apiCallTask = ApiHelperCities.Get(id);
            var result      = apiCallTask.Result;

            JObject jsonResponse = JsonConvert.DeserializeObject <JObject>(result);
            City    city         = JsonConvert.DeserializeObject <City>(jsonResponse.ToString());

            return(city);
        }
Esempio n. 2
0
        public static List <City> GetCities()
        {
            var apiCallTask = ApiHelperCities.GetAll();
            var result      = apiCallTask.Result;

            JArray      jsonResponse = JsonConvert.DeserializeObject <JArray>(result);
            List <City> cityList     = JsonConvert.DeserializeObject <List <City> >(jsonResponse.ToString());

            return(cityList);
        }
Esempio n. 3
0
 public static void Delete(int id)
 {
     var apiCallTask = ApiHelperCities.Delete(id);
 }
Esempio n. 4
0
 public static void Put(City city)
 {
     string jsonCity    = JsonConvert.SerializeObject(city);
     var    apiCallTask = ApiHelperCities.Put(city.CityId, jsonCity);
 }