Beispiel #1
0
        public TVShowEntity GetRandomTVShowByGenre(string genre)
        {
            List <TVShowGenre> temp = _tvgenre.GetByGenre(genre);
            var randomTVShow        = temp[_random.Next(temp.Count())];


            return(GetTVShowByTitle(randomTVShow.TVShow.Title));
        }
Beispiel #2
0
        public ActionResult <List <TVShowGenreResponse> > GetByGenre(string genre)
        {
            var tVShowGenre = _tvgenres.GetByGenre(genre);

            if (tVShowGenre == null)
            {
                return(NotFound());
            }

            List <TVShowGenreResponse> response = new List <TVShowGenreResponse>();

            foreach (var item in tVShowGenre)
            {
                TVShowGenreResponse temp = new TVShowGenreResponse()
                {
                    Title = item.TVShow.Title, Genre = item.Genre.Genre
                };
                response.Add(temp);
            }


            return(response);
        }