Skip to content

Instantly share code, notes, and snippets.

@fsanggang
Created November 1, 2020 23:39
Show Gist options
  • Select an option

  • Save fsanggang/9c265ddad5373128fd4f0134a3eb1006 to your computer and use it in GitHub Desktop.

Select an option

Save fsanggang/9c265ddad5373128fd4f0134a3eb1006 to your computer and use it in GitHub Desktop.
// Startup.cs
...etc
using Microsoft.AspNetCore.Authorization;
public void ConfigureServices(IServiceCollection services)
{
... etc
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddRoles<IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, UserManager<IdentityUser> userManager, RoleManager<IdentityRole> roleManager)
{
... etc
ApplicationInitialiser.Initialise(userManager, roleManager).Wait();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment