public async Task ConfigureDatabase(FutLabDbContext dc, UserManager <ApplicationUser> userManager, RoleManager <ApplicationRole> roleManager) { if (dc is null) { throw new ArgumentNullException(nameof(dc)); } if (userManager is null) { throw new ArgumentNullException(nameof(userManager)); } if (roleManager is null) { throw new ArgumentNullException(nameof(roleManager)); } // Migrate database to latest version await dc.Database.MigrateAsync().ConfigureAwait(false);
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, FutLabDbContext dc, UserManager <ApplicationUser> userManager, RoleManager <ApplicationRole> roleManager) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); }); // Configure database this.ConfigureDatabase(dc, userManager, roleManager).Wait(); }