public async Task RefreshEpisodes(int id) { // TODO: Throw exception here if show is not found or if more than 1 show is found var show = Shows.SingleOrDefault(s => s.Show.Id == id); show.Episodes.Clear(); GetEpisodesRequestModel request = new GetEpisodesRequestModel(); request.ShowId = show.Show.Id; IApiMethod episodesApi = new GetEpisodes(request); EpisodesResponseModel apiResult = await _apiService.CallApi <EpisodesResponseModel>(episodesApi); foreach (EpisodeResponseModel e in apiResult.Episodes) { show.Episodes.Add(new EpisodeViewModel { Episode = e }); } }
public GetEpisodes(GetEpisodesRequestModel requestModel) { _requestModel = requestModel; }