public Task <IEnumerable <Genres> > GetDBTVShowGenres(int tvShowId) { return(Task.Run(async() => { var tvShow = await _context.TVShows.FirstOrDefaultAsync(tv => tv.id == tvShowId); return (await _context.Entry(tvShow).Collection(tv => tv.TVShowGenres) .Query().Select(tvGenres => tvGenres.tvshow_genre_) .ToListAsync()).AsEnumerable(); })); }
public Task <IEnumerable <Genres> > GetDBMovieGenres(int movieId) { return(Task.Run(async() => { var movie = await _context.Movies.FirstOrDefaultAsync(m => m.id == movieId); return ( await _context.Entry(movie) .Collection(c => c.MovieGenres) .Query().Select(movieGenres => movieGenres.movie_genre_) .ToListAsync()) .AsEnumerable(); })); }