Esempio n. 1
0
        private static void BuildConfigs()
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);

            var configuration = builder.Build();

            _listenOnLoopBack = Convert.ToBoolean(configuration["ListenOnLoopback"]);

            _port = Convert.ToInt32(configuration["Port"]);

            _verboseOutput = Convert.ToBoolean(configuration["VerboseOutput"]);

            var cs = InterceptorModelFactory.LoadConnectionString();

            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine("===================================");
            Console.WriteLine("appsettings.json");
            Console.WriteLine("===================================");
            Console.ResetColor();

            PrintProperty("Listen on loop back", _listenOnLoopBack);
            PrintProperty("Listen on port     ", _port);
            PrintProperty("Verbose output     ", _verboseOutput);
            PrintProperty("Connection string  ", cs);
        }
Esempio n. 2
0
        protected InterceptorModel GetContext()
        {
            var context = new InterceptorModelFactory().CreateDbContext(null);

            return(context);
        }