Пример #1
0
        public static void Option1()
        {
            var mongoRepo = new MongoRepository(mongoProvider);
            mongoRepo.EreaseData();
            mongoRepo.InitData();

            Console.WriteLine("Config data saved to Mongo DB");
        }
Пример #2
0
        public static void Option2()
        {
            var mongoRepo = new MongoRepository(mongoProvider);
            var allProductsInDb = mongoRepo.GetProducts();
            var allIngredientsInDB = mongoRepo.GetIngredients();
            
            Console.WriteLine("Config data read from Mongo DB");

            var sqlServerRepo = new SqlServerRepository("SQLServer");
            sqlServerRepo.AddProducts(allProductsInDb);
            sqlServerRepo.AddIngredients(allIngredientsInDB);

            Console.WriteLine("Confog data written into MSSQL");
        }