public async Task SaveTaskAsync(TodoItem item) { if (item.ID == null) { await todoTable.InsertAsync(item); //TodoViewModel.TodoItems.Add(item); } else await todoTable.UpdateAsync(item); }
public async Task DeleteTaskAsync(TodoItem item) { try { //TodoViewModel.TodoItems.Remove(item); await todoTable.DeleteAsync(item); } catch (MobileServiceInvalidOperationException msioe) { Debug.WriteLine(@"INVALID {0}", msioe.Message); } catch (Exception e) { Debug.WriteLine(@"ERROR {0}", e.Message); } }