Пример #1
0
        public static void Main(string[] args)
        {
            // SQL STUFF HERE

            // get the configuration from file
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            //Use to confirm .json is being read in properly
            //Console.WriteLine(configuration.GetConnectionString("Project1DB"));

            var optionsBuilder = new DbContextOptionsBuilder <Project1DBContext>();

            optionsBuilder.UseSqlServer(configuration.GetConnectionString("Project1DB"));

            RH = new RepositoryHandler(new Project1DBContext(optionsBuilder.Options));

            //END SQL STUFF

            //Begin at first screen of the menu system
            MenuStart();

            //Close DB connection
            RH.DisposeOfDBContext();
        }