Example #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services.AddControllersWithViews();
            services.AddRazorPages();

            ModuleConfiguration conf = new ModuleConfiguration(services, Configuration);

            conf.ConfigureServices();
            conf.ConfigureDatabase();
            conf.ConfigureSecurity();
            conf.ConfigureCustomStartUpService();

            services.AddCors(o => o.AddDefaultPolicy(builder =>
            {
                builder.AllowAnyOrigin()
                .AllowAnyHeader()
                .AllowAnyMethod();
            }));

            //services.BuildServiceProvider().GetRequiredService<AdminConfiguration>().SeedAdminAndRoles();
        }