// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AppDbContext ctx, RoleManager <IdentityRole> roleManager, UserManager <ApplicationUser> userManager) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } //app.Run(async (context) => await context.Response.WriteAsync(System.Diagnostics.Process.GetCurrentProcess().ProcessName)); //app.UseDefaultFiles(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.UseAuthentication(); PreSeeder.Seeder(ctx, roleManager, userManager).Wait(); app.UseEndpoints(endpoints => { // home/index/number=1 endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AppDbContext ctx, RoleManager <IdentityRole> roleManager, UserManager <ApplicationUser> userManager) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseAuthentication(); PreSeeder.Seeder(ctx, roleManager, userManager).Wait(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AppDbContext ctx, RoleManager <IdentityRole> roleManager, UserManager <UserModel> userManager) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); // Preseeder Class Method Call PreSeeder.Seeder(ctx, roleManager, userManager).Wait(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Account}/{action=Login}/{id?}"); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AppDbContext ctx, RoleManager <IdentityRole> roleManager, UserManager <ApplicationUser> userManager) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Intl Wallet Api V1"); }); app.UseCors(x => x.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); PreSeeder.Seeder(ctx, roleManager, userManager).Wait(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AppDbContext context, RoleManager <IdentityRole> roleManager, UserManager <User> userManager) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseRouting(); //allows identity perform authentication app.UseAuthentication(); app.UseAuthorization(); //add preseeder to pipeline PreSeeder.Seeder(context, roleManager, userManager).Wait(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }