void LoadEntries() { if (IsBusy) { return; } IsBusy = true; LogEntries.Clear(); try { _cache.GetAndFetchLatest("entries", async() => await _tripLogService.GetEntriesAsync()) .Subscribe(entries => LogEntries = new ObservableCollection <TripLogEntry>(entries)); } catch (Exception e) { AnalyticsService.TrackError(e, new Dictionary <string, string> { { "Method", "MainViewModel.LoadEntries()" } }); } finally { IsBusy = false; } }
private void LoadEntries() { if (IsBusy) { return; } IsBusy = true; LogEntries.Clear(); try { _cache.GetAndFetchLatest("entries", async() => await _tripLogService.GetEntriesAsync()) .Subscribe(x => LogEntries = new ObservableCollection <TripLogEntry>(x), ex => System.Diagnostics.Debug.WriteLine("No Key")); } finally { IsBusy = false; } }
void LoadEntries() { if (IsBusy) { return; } IsBusy = true; LogEntries.Clear(); try { //Load data from the cache and then get entries from azure database _cache.GetAndFetchLatest("entries", async() => await _tripLogDataService.GetEntriesAsync()) .Subscribe(entries => LogEntries = new ObservableCollection <TripLogEntry>(entries)); } finally { IsBusy = false; } }
void LoadEntries() { if (IsBusy) { return; } IsBusy = true; LogEntries.Clear(); try { // Load from local cache and then immediately load from API _cache.GetAndFetchLatest("entries", async() => await _tripLogService.GetEntriesAsync()) .Subscribe(entries => LogEntries = new ObservableCollection <TripLogEntry>(entries)); } finally { IsBusy = false; } }