Ejemplo n.º 1
0
 private async Task <bool> SetLastUpdatedNow(UpdateableTableNames updateableTableName)
 {
     return(1 == await _conn.InsertOrReplaceAsync(new MobileModelData.LastUpdated()
     {
         TableName = updateableTableName.ToString(), LastUpdatedUTC = DateTime.UtcNow
     }));
 }
Ejemplo n.º 2
0
        private async Task <bool> NeedsDataRefresh(UpdateableTableNames updateableTableName)
        {
            string tableName = updateableTableName.ToString();
            var    record    = await _conn.Table <MobileModelData.LastUpdated>().Where(x => x.TableName == tableName).FirstOrDefaultAsync();

            if (record != null)
            {
                return((record.LastUpdatedUTC < DateTime.UtcNow.AddMinutes(MAX_MINUTES_BETWEEN_UPDATES)) ? true : false);
            }
            return(true);
        }