public async Task<bool> MarkAs (ShoppingListItem item, bool mark) { if ( !IsLoggedIn || item.Id == 0 ) { return false; } item.Checked = mark; string url = ITEM_URL + item.Id; HttpResponseMessage response = await client.PutAsJsonAsync<ShoppingListItem> (url, item); ShoppingListItem modified = await response.Content.ReadAsAsync<ShoppingListItem> (); return modified.Checked == mark; }
public Task<bool> MarkAsNotDone (ShoppingListItem item) { return MarkAs (item, false); }
public Task<bool> MarkAsDone (ShoppingListItem item) { return MarkAs (item, true); }