Ejemplo n.º 1
0
        /// <summary>
        /// Use this only to see what can be extracted
        /// </summary>
        public Dictionary <string, object> ExtractDataFromMovieObject(Movie movie)
        {
            var people = new List <Entities.Person>();

            var m = new Entities.Movie
            {
                FilmingLocations = movie.FilmingLocations,
                Genres           = movie.Genres,
                Countries        = movie.Countries,
                Languages        = movie.Languages,
                Plot             = movie.Plot,
                Rated            = movie.Rated,
                Title            = movie.Title,
                Rating           = movie.Rating,
                Year             = movie.Year
            };

            people.AddRange(movie.Actors.Select(a => new Person {
                Name = a.ActorName
            }));
            people.AddRange(movie.Directors.Select(d => new Person {
                Name = d.Name
            }));
            people.AddRange(movie.Writers.Select(w => new Person {
                Name = w.Name
            }));

            return(new Dictionary <string, object>
            {
                { "Movie", m },
                { "People", people }
            });
        }
        /// <summary>
        /// Use this only to see what can be extracted
        /// </summary>
        public Dictionary<string, object> ExtractDataFromMovieObject(Movie movie)
        {
            var people = new List<Entities.Person>();

            var m = new Entities.Movie
            {
                FilmingLocations = movie.FilmingLocations,
                Genres = movie.Genres,
                Countries = movie.Countries,
                Languages = movie.Languages,
                Plot = movie.Plot,
                Rated = movie.Rated,
                Title = movie.Title,
                Rating = movie.Rating,
                Year = movie.Year
            };

            people.AddRange(movie.Actors.Select(a => new Person {Name = a.ActorName}));
            people.AddRange(movie.Directors.Select(d => new Person {Name = d.Name}));
            people.AddRange(movie.Writers.Select(w => new Person {Name = w.Name}));

            return new Dictionary<string, object>
            {
                {"Movie", m},
                {"People", people}
            };
        }