//Call everytime the App starts
        public async Task SyncTableUpdates()
        {
            var result = await MobileService.GetTable <table_update>().Take(_takeNRows).ToListAsync();

            _liteConnection.DeleteAll <table_update>();
            foreach (var item in result)
            {
                //Convert to UTC
                item.updated_at = item.updated_at.ToUniversalTime();
                _liteConnection.Insert(item);
            }
        }
        //Call everytime the App starts
        public async Task SyncTableUpdates()
        {
            try {
                var result = await MobileService.GetTable <table_update>().Where(t => t.id > 0).LoadAllAsync();

                Debug.WriteLine("********* &&&&& " + result.Count);
                // var result = await MobileService.GetTable<table_update>().Take(_takeNRows).ToListAsync();
                _liteConnection.DeleteAll <table_update>();
                foreach (var item in result)
                {
                    //Convert to UTC
                    item.updated_at = item.updated_at.ToUniversalTime();
                    _liteConnection.Insert(item);
                }
            } catch (Exception e) {
                throw(e);
            }
        }
示例#3
0
 public void DeleteAll()
 {
     _connection.DeleteAll <T>();
 }
示例#4
0
        public void CleanResults()
        {
            _connection.DeleteAll <Answer> ();

            _messenger.Publish(new ResultsChangedMessage(this, ResultsChangedMessage.ResultsCleared));
        }