I\'ve created a test project using:
dotnet new razor --auth Individual --output Test
This creates a Startup.cs that contains:
p
It seems that finally Microsoft understood that not every application needs roles and separated them.
Notice that AddDefaultIdentity
is declared as:
public static IdentityBuilder AddDefaultIdentity(this IServiceCollection services) where TUser : class;
So, you can continue to configure Identity options through that IdentityBuilder
. What you want to do is:
services.AddDefaultIdentity().AddRoles();
Fortunately, they also removed the IUser
and IRole
constrains, so now you can use models in a completely separate assembly without having to install hundreds of NuGet packages.