Tag: ef migrations

种子实体和用户,角色?

您如何为用户,角色和应用程序特定实体设定种子? 似乎IdentityModel以其自己的Context为目标? internal sealed class Configuration : DbMigrationsConfiguration { public Configuration() { AutomaticMigrationsEnabled = false; } protected override void Seed(Project.Models.SchoolContext context) { // Seed the Entities // context.People.AddOrUpdate( // p => p.FullName, // new Person { FullName = “Andrew Peters” } // ); // } } 与 protected override void Seed(Project.Models.ApplicationDbContext context) { if (!context.Roles.Any(r […]