Example #1
0
        public async Task<bool> DeleteTaskModelAsync(SharedContenItemtModel taskModel)
        {
            var httpClient = new HttpClient();

            var response = await httpClient.DeleteAsync(WebServiceUrl + taskModel.Id);

            return response.IsSuccessStatusCode;
        }
Example #2
0
        public async Task<bool> AddTaskModelAsync(SharedContenItemtModel taskModel)
        {
            var httpClient = new HttpClient();

            var json = JsonConvert.SerializeObject(taskModel);

            HttpContent httpContent = new StringContent(json);

            httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");

            var result = await httpClient.PostAsync(WebServiceUrl, httpContent);

            return result.IsSuccessStatusCode;
        }