AddEntityFrameworkStores Can Only Be Called With A Role That Derives From IdentityRole In .NET Core 2.0


Answer :

Long time since I asked this question, but here's how I deal with nowadays:

Startup.cs

services.AddIdentity<User, Role>() .AddEntityFrameworkStores<ApplicationDbContext>() .AddDefaultTokenProviders(); services.AddScoped<RoleManager<Role>>(); 

Entites:

public class User : IdentityUser<int> { }  public class Role : IdentityRole<int> { } 

For same issue, you can look at this:https://github.com/aspnet/Identity/issues/1364


Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable