예제 #1
0
        private CovidTestContext GetContext()
        {
            var options = new DbContextOptionsBuilder()
                          .UseSqlite("Data Source=CovidTest.db")
                          .Options;
            var db = new CovidTestContext(options);

            db.Database.EnsureDeleted();
            db.Database.EnsureCreated();
            db.Import("data.sql");
            return(db);
        }
예제 #2
0
파일: Program.cs 프로젝트: schletz/Pos5xhif
        public static void Main(string[] args)
        {
            Process currentProcess = Process.GetCurrentProcess();

            Console.WriteLine($"********************************************************************************");
            Console.WriteLine($"* PROCESS ID: {currentProcess.Id}");
            Console.WriteLine($"********************************************************************************");
            using (var db = new CovidTestContext(new DbContextOptionsBuilder()
                                                 .UseSqlite("Data Source=CovidTest.db")
                                                 .Options))
            {
                db.Database.EnsureDeleted();
                db.Database.EnsureCreated();
                db.Import("data.sql");
            }
            CreateHostBuilder(args).Build().Run();
        }