/// <summary> /// Removes all movies from the list argument that do not have all of the /// languages that are specified in the argument. /// </summary> /// <param name="movies"></param> /// <param name="languageName"></param> private List <string> FilterMoviesByLanguages(string[] languageNames) { var filterResults = new List <List <string> >(); foreach (var languageName in languageNames) { var language = _repo.GetLanguage(languageName); if (language != null) { var movieLanguages = _repo.GetMovieLanguagesById(language.LanguageId); var filterResult = new List <string>(); foreach (var movieLanguage in movieLanguages) { filterResult.Add(movieLanguage.ImdbId); } filterResults.Add(filterResult); } } var movieIds = GetIntersection(filterResults); return(movieIds); }