private void RefreshByEpisodeId(long episodeId) { IsLoading = true; _tvshowtimeApiService.GetEpisode(new EpisodeRequestByEpisodeId { EpisodeId = episodeId }) .Subscribe(async(episodeResponse) => { await DispatcherHelper.ExecuteOnUIThreadAsync(() => { LastLoadingDate = DateTime.Now; Episode = episodeResponse.Episode; RaisePropertyChanged(nameof(Episode)); IsLoading = false; }); }, async(error) => { await DispatcherHelper.ExecuteOnUIThreadAsync(() => { IsLoading = false; }); _toastNotificationService.ShowErrorNotification("An error happened. Please retry later."); }); }
private void RefreshByEpisodeId(long episodeId) { var request = new EpisodeRequestByEpisodeId { EpisodeId = episodeId }; _tvshowtimeApiService.GetEpisode(request) .Subscribe(async(episodeResponse) => { await DispatcherHelper.ExecuteOnUIThreadAsync(() => { Episode = episodeResponse.Episode; RaisePropertyChanged(nameof(Episode)); }); }, (error) => { throw new Exception(); }); }