Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var db = new Model1Container();

            if (!db.DatabaseExists())
            {
                db.CreateDatabase();
            }

            var dump = new MyMoviesDump(db);

            for (int i = 2030; i >= 1800; i--)
            {
                dump.DumpYear(i);
            }


            var gen = new MoviesFileGenerator();

            dump.SaveGenreToBinaryFile(gen);
            gen.Save(@"..\..\..\TvGuide\Movies.dat");

            //update Movies set Genre=NULL WHERE Genre IN ('   Genere       ', ', ', 'Non definito') or Genre like '%genere%'



            Console.WriteLine("Done.");
            //      Console.ReadKey();
        }
Exemplo n.º 2
0
        internal void SaveGenreToBinaryFile(MoviesFileGenerator store)
        {
            var movies = db.Movies.OrderBy(x => x.MyMoviesId);

            foreach (var movie in movies)
            {
                Console.WriteLine(movie.Title);
                store.AddMovie(movie);
            }
        }