Семенные объекты и пользователи, роли?

Как вы разделяете пользователей, роли и приложения? Похоже, что IdentityModel предназначается для своего собственного контекста?

internal sealed class Configuration : DbMigrationsConfiguration<Project.Models.SchoolContext>
{
    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 => r.Name == "AppAdmin"))
    {
        var store = new RoleStore<IdentityRole>(context);
        var manager = new RoleManager<IdentityRole>(store);
        var role = new IdentityRole { Name = "AppAdmin" };
        manager.Create(role);
    }

    if (!context.Users.Any(u => u.UserName == "founder"))
    {
        var store = new UserStore<ApplicationUser>(context);
        var manager = new UserManager<ApplicationUser>(store);
        var user = new ApplicationUser {UserName = "founder"};

        manager.Create(user, "ChangeItAsap!");
        manager.AddToRole(user.Id, "AppAdmin");
    }
}

Ответы на вопрос(1)

Ваш ответ на вопрос