private async Task <bool> SetLastUpdatedNow(UpdateableTableNames updateableTableName) { return(1 == await _conn.InsertOrReplaceAsync(new MobileModelData.LastUpdated() { TableName = updateableTableName.ToString(), LastUpdatedUTC = DateTime.UtcNow })); }
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); }