コード例 #1
0
		public async Task SaveTaskAsync(TodoItem item)
		{
			if (item.ID == null)
			{
				await todoTable.InsertAsync(item);
				//TodoViewModel.TodoItems.Add(item);
			}
			else
				await todoTable.UpdateAsync(item);
		}
コード例 #2
0
		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);
			}
		}