using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; namespace OAuthServer; public class AppDbContext : IdentityDbContext { public AppDbContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); // Setup Identity roles modelBuilder.Entity().HasData( new IdentityRole {Id = Guid.NewGuid().ToString(), Name = "User", NormalizedName = "USER"}, new IdentityRole {Id = Guid.NewGuid().ToString(), Name = "External", NormalizedName = "EXTERNAL"} ); } }