How do I seed user roles in Identity ASP.NET Core 2.1 (Identity Scaffolded)
问题 How do I seed a "admin" user role when identity is scaffolded? I would like to find my power-user account by email and seed the admin role. Most examples I find use Startup.cs , but you are supposed to use IdentityHostingStartup.cs to register identity related services. So where/how do I inject the RoleManager and UserManager in IdentityHostingStartup ? (I assume this is what I need, please let me know if there is a better way) public class IdentityHostingStartup : IHostingStartup { public