Example #1
0
        async Task RefreshDataFromLocalDatabaseAsync()
        {
            try
            {
                var dataListAsIEnumerable = await DependencyService.Get <IDataService>().GetItemsFromLocalDatabaseAsync <ListPageDataModel>();

                DataList = dataListAsIEnumerable?.ToList();
            }
            catch (Exception e)
            {
                AnalyticsHelpers.Log("Error Retriving Data From Local Database", e.Message, e);
            }
        }
Example #2
0
        async Task RefreshDataFromAzureAsync()
        {
            var isAzureDatabaseReachable = await CrossConnectivity.Current.IsRemoteReachable(AzureConstants.AzureDataServiceUrl, 80, 1000);

            if (!CrossConnectivity.Current.IsConnected || !isAzureDatabaseReachable)
            {
                return;
            }

            try
            {
                var dataListAsIEnumerable = await DependencyService.Get <IDataService>().GetItemsAsync <ListPageDataModel>();

                DataList = dataListAsIEnumerable.ToList();
            }
            catch (Exception e)
            {
                AnalyticsHelpers.Log("Error Retrieving Data From Azure", e.Message, e);
            }
        }