Exemplo n.º 1
0
        private static void StartDemoUseFile()
        {
            System.Console.WriteLine("Starting Demo Application (File)");
            System.Console.WriteLine(string.Empty);

            using (var context = new LoginDbContext(@"data source=.\db\footballDb\footballDb.sqlite;foreign keys=true"))
            {
                CreateAndSeedDatabase(context);
                DisplaySeededData(context);
            }
        }
Exemplo n.º 2
0
        private static void StartDemoUseInMemory()
        {
            System.Console.WriteLine("Starting Demo Application (In Memory)");
            System.Console.WriteLine(string.Empty);

            using (var sqLiteConnection = new SQLiteConnection("data source=:memory:"))
            {
                // This is required if a in memory db is used.
                sqLiteConnection.Open();

                using (var context = new LoginDbContext(sqLiteConnection, false))
                {
                    CreateAndSeedDatabase(context);
                    DisplaySeededData(context);
                }
            }
        }