Seed Identity User and Role In ASP.Net Core with EF Core

Seeding is the process of creating an initial set of data in the database.

In the OnModelCreating method of my database context, I use the below code to

  • Seed a new “admin” role
  • Seed a new admin user
  • Seed admin into the role

--

--

Ofoedu Frank Ebuka

Senior C# Engineer. Nigerian. I enjoy writing about issues that took me a while to figure out. Contact me here → frankofoedu@gmail.com