public async Task Sync()
        {
            try
            {
                //if (!_connectivity.IsConnected) return;

                await SyncTable.PullAsync($"KinderRegistration", SyncTable.CreateQuery());

                await MobileService.SyncContext.PushAsync();
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Unable to sync coffees, that is alright as we have offline capabilities: " + ex);
            }
        }
Exemple #2
0
        public async Task PullTest()
        {
            Sync sync = await Sync.Create();

            SyncTable <AilmentCategory> syncTable = new SyncTable <AilmentCategory>(sync);
            //await syncTable.InsertAsync(new AilmentCategory { AilmentCategoryId = 1, AilmentCategoryName = "abc", StoreId = "1" });
            await syncTable.PullAsync(syncTable.ToString(), syncTable.GetQuery());

            List <AilmentCategory> readList = await syncTable.ReadAsync();

            Assert.AreNotEqual(0, readList.Count);
            foreach (AilmentCategory ac in readList)
            {
                Assert.AreEqual("1", ac.StoreId);
            }
        }