public IActionResult Details(int id) { Serie serie = _mediaService.GetAllSeries().FirstOrDefault(x => x.Id == id); var allseasons = _mediaService.GetAllSeasons(); serie.Seasons = _mediaService.GetAllSeasons().Where(Season => Season.Serie == serie).ToList(); SerieDetailViewModel vm = MapToViewModel(serie); // SetSeasonsAndEpisodes(vm); return(View(vm)); }
public IActionResult AddEpisode(int serieId) { var selectedSerie = _mediaService.GetAllSeries().First(serie => serie.Id == serieId); selectedSerie.Seasons = _mediaService.GetAllSeasons().Where(z => z.Serie.Id == serieId).ToList(); var Seasonen = selectedSerie.Seasons == null ? new List <Season>() : selectedSerie.Seasons.ToList(); EpisodeCreateViewModel Epimodel = new EpisodeCreateViewModel() { SerieName = selectedSerie.Name, PossibleSeasons = Seasonen, ReleaseDate = DateTime.Now }; return(View(Epimodel)); }