Exemple #1
0
        public async Task InsertSocItemAsync(SocialItem sItem)
        {
            try
            {
                await socTable.InsertAsync(sItem); // Insert a new SocialItem into the local database.
                await SyncAsync();                 // send changes to the mobile service

                Items.Add(sItem);
            }
            catch (MobileServiceInvalidOperationException e)
            {
                Console.Error.WriteLine(@"ERROR {0}", e.Message);
            }
        }
Exemple #2
0
        public async Task CompleteItemAsync(SocialItem item)
        {
            try
            {
                item.Id = null;
                await socTable.UpdateAsync(item); // update social item in the local database
                await SyncAsync();                // send changes to the mobile service

                Items.Remove(item);
            }
            catch (MobileServiceInvalidOperationException e)
            {
                Console.Error.WriteLine(@"ERROR {0}", e.Message);
            }
        }