Esempio n. 1
0
        public IEnumerable <Movie> GetMovies(string movieGenre, string name)
        {
            var movies = _dal.GetMovies();

            if (!string.IsNullOrEmpty(name))
            {
                movies = movies.Where(s => s.Title.Contains(name));
            }

            if (!string.IsNullOrEmpty(movieGenre))
            {
                movies = movies.Where(m => m.Genre == movieGenre);
            }

            return(movies.AsEnumerable());
        }