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);
        }
Beispiel #2
0
        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();
        }