private async Task SyncList(ShoppingList i) { if (i.Deleted) { try { var ret = await _client.DeleteShoppingListAsync(i.Id); if (_currentLists.Contains(i)) { _currentLists.Remove(i); } SetSynced(i); } catch (Exception ex) { Console.WriteLine(ex); } } else { var ret = await _client.UpdateShoppingListAsync(i.ToRest()); i.Id = ret.Id; SetSynced(i); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> public static bool?DeleteShoppingList(this IShoppingAPI operations, int id) { return(operations.DeleteShoppingListAsync(id).GetAwaiter().GetResult()); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> public static void DeleteShoppingList(this IShoppingAPI operations, int id) { operations.DeleteShoppingListAsync(id).GetAwaiter().GetResult(); }