Exemple #1
0
        public async Task DeleteItemAsync(AudioItem item)
        {
            // RestUrl = http://developer.xamarin.com:8081/api/todoitems/{0}
            var uri = new Uri(string.Format(Constants.RestUrlAudio, string.Empty));

            try
            {
                item.ToBeDeleted = true;

                var json    = JsonConvert.SerializeObject(item);
                var content = new StringContent(json, Encoding.UTF8, "application/json");

                response = await client.PutAsync(uri, content);

                if (response.IsSuccessStatusCode)
                {
                    Debug.WriteLine(@"				Item successfully deleted.");
                }
            } catch (Exception ex)
            {
                Debug.WriteLine(@"				ERROR {0}", ex.Message);
            }
        }
Exemple #2
0
 public Task DeleteTaskAsync(AudioItem item)
 {
     return(restService.DeleteItemAsync(item));
 }
Exemple #3
0
 public Task SaveTaskAsync(AudioItem item, bool isNewItem = false)
 {
     return(restService.SaveItemAsync(item, isNewItem));
 }