// This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <ConfigSettingsBase>(Configuration.GetSection("ConfigSettings"));
            services.Configure <ConfigConnectionStringBase>(Configuration.GetSection("ConfigConnectionString"));
            services.AddSingleton <IConfiguration>(Configuration);

            var authorityEndPoint = Configuration.GetSection("ConfigSettings:AuthorityEndPoint").Value;

            services.AddAuthentication(options =>
            {
                options.DefaultScheme          = "Cookies";
                options.DefaultChallengeScheme = "oidc";
            })
            .AddCookie("Cookies")
            .AddOpenIdConnect("oidc", options =>
            {
                options.SignInScheme = "Cookies";

                options.Authority            = authorityEndPoint;
                options.RequireHttpsMetadata = false;

                options.ClientId   = "hangfire-dash";
                options.SaveTokens = true;
            });

            // Add cross-origin resource sharing services Configurations
            Cors.Enable(services);

            var connectionString = Configuration.GetSection("ConfigConnectionString:Default").Value;

            //services.AddHangfire(x => x.UseSqlServerStorage(connectionString));
            services.AddHangfire(x => x.UseMemoryStorage());

            // Add application services.
            ConfigContainer.Config(services);

            services.AddMvc();
        }