Пример #1
0
        public async Task <string> PutLocation(WebModels.LocationModel location)
        {
            DataModels.Location dataLocation = location.GetDataModel();
            StringContent       sc           = new StringContent(JsonConvert.SerializeObject(dataLocation), System.Text.Encoding.UTF8, "application/json");

            HttpResponseMessage response = await PUT(sc, Constants.ENDPOINT_POST_LOCATION).ConfigureAwait(false);

            string result = await response.Content.ReadAsStringAsync();

            return(result);
        }
Пример #2
0
        public async Task <WebModels.LocationModel> GetLocationDetails(int locationId)
        {
            string url = Constants.ENDPOINT_GET_LOCATION_DETAILS + "/" + locationId.ToString();

            HttpResponseMessage response = await GET(url);

            var result = await response.Content.ReadAsStringAsync();

            DataModels.Location dataLocation = JsonConvert.DeserializeObject <DataModels.Location>(result);

            WebModels.LocationModel webLocation = new WebModels.LocationModel(dataLocation);

            return(webLocation);
        }