예제 #1
0
        static void Main(string[] args)
        {
            // grab connection string and deserialize it
            string connectionString =  ReadData.GetConnectionString();

            // log in using sql server
            using var logStream = new StreamWriter("ef-logs.txt");

            var optionsBuilder = new DbContextOptionsBuilder<StoreDBContext>();
            optionsBuilder.UseSqlServer(connectionString);
            optionsBuilder.LogTo(logStream.WriteLine, LogLevel.Information);

            s_dbContextOptions = optionsBuilder.Options;
            StoreRepository db = new StoreRepository(s_dbContextOptions);


            // acess the main menu
            SqlConsoleUi.mainMenu(db);

        }