private static void UpdateDatabase(FluentModelContext context)
 {
     using (context)
     {
         var schemaHandler = context.GetSchemaHandler();
         EnsureDB(schemaHandler);
     }
 }
        public static void Main(string[] args)
        {
            var files = ReadJsonFiles();

            var dbContext  = new FluentModelContext();
            var repository = new OpenAccessRepository <SalesReport>(dbContext);
            var unitOfWork = new OpenAccessUnitOfWork(dbContext);

            ImportToMySqlDatabase(repository, unitOfWork, files);
        }
示例#3
0
        public static void Main(string[] args)
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion <WayneCarCorpsContext, Configuration>());
            var db = new WayneCarCorpsContext();

            db.Database.CreateIfNotExists();
            var cars   = new MongoDBExtractor <MongoCar>().GetEntitiesCollection("Cars");
            var kernel = BootstrapNinject();

            var carsImporter = kernel.Get <CarsImporter>();

            carsImporter.import(cars);

            var xmlImporter = kernel.Get <XmlImporter>();

            xmlImporter.Import();

            var zipExtractor = kernel.Get <ExcelReader>();

            zipExtractor.ExtractZipFiles();

            var pdfExporter = kernel.Get <PdfExporter>();

            pdfExporter.CreatePdfTable();

            var jsonExporter = kernel.Get <JsonWriter>();

            jsonExporter.WriteToJson();

            var xmlExporter = kernel.Get <XmlReportExporter>();

            xmlExporter.GetSalesForEachDealership();


            // CHANGE PASSWORD IN CONNECTIONS STRING
            FluentModelContext context = new FluentModelContext();
            OpenAccessRepository <SalesReport> report = new OpenAccessRepository <SalesReport>(context);
            //ExcelWriter.WriteToExcel(report);

            //UpdateMongoDB();
        }
        public static void Main()
        {
            var context = new FluentModelContext();

            UpdateDatabase(context);
        }
示例#5
0
 public OpenAccessUnitOfWork(FluentModelContext dbContext)
 {
     this.dbContext = dbContext;
 }
 public OpenAccessRepository(FluentModelContext context)
 {
     this.Context = context;
 }