Exemple #1
0
 public async Task SaveTaskAsync(UsersUPT item)
 {
     if (item.Id == null)
     {
         await userTableObj.InsertAsync(item);
     }
     else
     {
         await userTableObj.UpdateAsync(item);
     }
 }
Exemple #2
0
        public async Task <ObservableCollection <UsersUPT> > GetTodoItemsAsync(string idBuscar)
        {
            UsersUPT u = new UsersUPT();

            try
            {
                IEnumerable <UsersUPT> items = await userTableObj.Where(userTableObj => userTableObj.PID == idBuscar).ToEnumerableAsync();

                return(new ObservableCollection <UsersUPT>(items));
            }
            catch (MobileServiceInvalidOperationException msioe)
            {
                Debug.WriteLine($"Invalid sync operation: {msioe.Message}");
            }
            catch (Exception ex)
            {
                Debug.WriteLine($"Sync Error: {ex.Message}");
            }
            return(null);
        }