public void Configure(IApplicationBuilder app, IWebHostEnvironment env, RoleManager <IdentityRole> roleMgr, UserManager <Gebruiker> userMgr, AstrologyQuizDbContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                app.UseHsts();
            }

            app.UseCors(builder => {
                builder.WithOrigins("http://localhost:3000")
                .AllowAnyHeader()
                .AllowAnyMethod()
                .AllowCredentials();
            });

            app.UseHttpsRedirection();

            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthentication();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Quiz}/{action=Index}/{id?}");
                endpoints.MapRazorPages();
            });

            Seeders.SeedRoles(roleMgr).Wait();

            Seeders.SeedUsers(userMgr).Wait();
        }
Beispiel #2
0
 public GenericRepo(AstrologyQuizDbContext context)
 {
     this.context = context;
 }
Beispiel #3
0
 public QuizGebruikerRepo(AstrologyQuizDbContext context) : base(context)
 {
     this.context = context;
 }
 public VraagRepo(AstrologyQuizDbContext context) : base(context)
 {
     this.context = context;
 }
 public MoeilijkheidsgraadRepo(AstrologyQuizDbContext context) : base(context)
 {
     this.context = context;
 }
 public AntwoordRepo(AstrologyQuizDbContext context) : base(context)
 {
     this.context = context;
 }