public static void Main() { //string ConnetionString = "mongodb://localhost:27017"; //string DbName = "artgallerydb"; //var client = new MongoClient(ConnetionString); //MongoServer server = client.GetServer(); //var mongoDb = server.GetDatabase(DbName); // var result = mongoDb.GetCollection<Artist>("artists").AsQueryable<Artist>(); Database.SetInitializer(new MigrateDatabaseToLatestVersion<ArtGalleryDbContext, Configuration>()); var data = new ArtGalleryDbContext(); var dataImporter = new MongoDb(); var consoleWriter = new TextWriter(Console.Out); var msSqlDbDataImporter = new MsSqlDbDataImporter(dataImporter, data); msSqlDbDataImporter.Subscribe(consoleWriter); msSqlDbDataImporter.ImportData(); //db.Artists.Add(new ArtistSql //{ // FirstName = "Pesho", // MiddleName = "d", // LastName = "Gosho" //}); }
public void Run() { /// string PathToReportsArchive = @"../../Data/SalesReports.zip"; /// string PathToReports = @"../../Data/SalesReports"; var data = new ArtGalleryDbContext(); var dataImporter = new MongoDb(); var consoleWriter = new TextWriter(Console.Out); var sqlDbDataImporter = new MsSqlDbDataImporter(dataImporter, data); var archiver = new ArchiveHandler(); sqlDbDataImporter.Subscribe(consoleWriter); sqlDbDataImporter.ImportData(); archiver.Subscribe(consoleWriter); /// archiver.UnzipToFolder(PathToReportsArchive, PathToReports); var transfer = new TransferDataFromExcelToDB(data); transfer.GetFile(); }