Ejemplo n.º 1
0
        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='listData'>
 /// </param>
 public static ShoppingList UpdateShoppingList(this IShoppingAPI operations, ShoppingList listData = default(ShoppingList))
 {
     return(operations.UpdateShoppingListAsync(listData).GetAwaiter().GetResult());
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 /// <param name='listData'>
 /// </param>
 public static void UpdateShoppingList(this IShoppingAPI operations, int id, ShoppingList listData = default(ShoppingList))
 {
     operations.UpdateShoppingListAsync(id, listData).GetAwaiter().GetResult();
 }
Ejemplo n.º 4
0
 public async Task UpdateList(ShoppingList shoppingList)
 {
     await _client.UpdateShoppingListAsync(shoppingList.Id, shoppingList);
 }