Esempio n. 1
0
        public void Run()
        {
            try
              {
            Console.WriteLine("Reading Configuration");
            var builder = new ConfigurationBuilder()
             .SetBasePath(PlatformServices.Default.Application.ApplicationBasePath)
             .AddJsonFile("config.json")
             .AddEnvironmentVariables();

            _config = builder.Build();
            _ctx = new OldWilderContext(_config);
            _newCtx = new WilderContext(_config);
            _repo = new WilderRepository(_config, _newCtx);

            Console.WriteLine("Migrating Stories");
            MigrateStories();

            //TODO More migration

              }
              catch (Exception ex)
              {
            Console.WriteLine(ex.ToString());
            Console.ReadKey();
              }
        }
Esempio n. 2
0
        public void Run(string command)
        {
            try
            {
                Console.WriteLine("Reading Configuration");
                var builder = new ConfigurationBuilder()
                              .SetBasePath(PlatformServices.Default.Application.ApplicationBasePath)
                              .AddJsonFile("config.json")
                              .AddEnvironmentVariables();

                _config = builder.Build();
                _ctx    = new OldWilderContext(_config);
                _newCtx = new WilderContext(_config);
                _repo   = new WilderRepository(_config, _newCtx);


                if (command == "" || command == "stories" || command == "comments")
                {
                    MigrateStories(command == "comments");
                }
                if (command == "" || command == "podcast")
                {
                    MigratePodcast();
                }
                if (command == "" || command == "publications")
                {
                    MigratePublications();
                }
                if (command == "" || command == "calendar")
                {
                    MigrateCalendar();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                Console.ReadKey();
            }
        }