invalidoperationexception: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.RoleManager`1[Microsoft.AspNetCore.Identity.IdentityRole]' while attempting to activate code example
Example 1: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager
services.AddIdentity<Automobile.Models.Account, IdentityRole>(options =>
{
options.User.RequireUniqueEmail = false;
})
.AddEntityFrameworkStores<Providers.Database.EFProvider.DataContext>()
.AddDefaultTokenProviders();
Example 2: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.RoleManager`1[Microsoft.AspNetCore.Identity.IdentityRole]' while attempting to activate 'PathApp.Controllers.SearchPathController'.
services.AddDefaultIdentity<ApplicationUser().AddRoles<IdentityRole>().AddEntityFrameworkStores<ApplicationDbContext>();