/// <summary> /// 通过推荐列表中的movieId找到相关的电影的全部信息 /// </summary> /// <param name="result"></param> /// <returns></returns> private static ArrayList getRecommendMovie(IronPython.Runtime.List result) { ArrayList recommendMovie = new ArrayList(); for (int i = 0; i < result.Count; i++) { PythonTuple pySet = result.ElementAt(i) as PythonTuple; int movieId = (int)pySet.ElementAt(0); RecommendMovie rdMovie = new RecommendMovie(); rdMovie.Similarity = (double)pySet.ElementAt(1); try { rdMovie.Movie = MovieHelper.GetMovieById(movieId); } catch (Exception e) { throw (e); } recommendMovie.Add(rdMovie); } return(recommendMovie); }