StreetFoo.Client.ReportItem.IsCacheEmpty C# (CSharp) Method

IsCacheEmpty() static private method

static private IsCacheEmpty ( ) : Task
return Task
        internal static async Task<bool> IsCacheEmpty()
        {
            var conn = StreetFooRuntime.GetUserDatabase();
            return (await conn.Table<ReportItem>().FirstOrDefaultAsync()) == null;
        }
    }

Usage Example

Esempio n. 1
0
        private async Task DoRefresh(bool force)
        {
            // run...
            using (this.EnterBusy())
            {
                // update the local cache...
                if (force || await ReportItem.IsCacheEmpty())
                {
                    await ReportItem.UpdateCacheFromServerAsync();
                }

                // reload the items...
                await this.ReloadReportsFromCacheAsync();
            }
        }