public ActionResult Index() { IReadOnlyCollection <PodcastModel> podcasts = _podcastService.GetPodcasts(); var model = new PodcastViewModel { Podcasts = podcasts }; return(View(model)); }
public void UpdatePodcastList() { try { DisplayChangeAllComponent(false); WriteLog("podcast listesi alınıyor."); _podcasts = _podcastService.GetPodcasts(); _podcasts.Reverse(); listBoxPodcast.Items.Clear(); foreach (var item in _podcasts) { listBoxPodcast.Items.Add(item.TitlePodcast); } WriteLog(""); lblPodcastCount.Text = $"Podcast Sayısı: {_podcasts.Count.ToString()}"; } catch (Exception exp) { WriteLog(exp.Message); } finally { DisplayChangeAllComponent(true); } }
public async Task <IActionResult> Podcasts() { IEnumerable <IPodcastModel> podcastModels = await _podcastService.GetPodcasts(); return(Ok(podcastModels)); }