protected override void Seed(BetovenDBContext context) { // This method will be called after migrating to the latest version. // You can use the DbSet<T>.AddOrUpdate() helper extension method // to avoid creating duplicate seed data. var RoleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(new ApplicationDbContext())); if (RoleManager.RoleExists("Admin") == false) { RoleManager.Create(new IdentityRole("Admin")); } if (RoleManager.RoleExists("User") == false) { RoleManager.Create(new IdentityRole("User")); } }
public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager) { UserManager = userManager; SignInManager = signInManager; DBContext = new BetovenDBContext(); }
public AccountController() { DBContext = new BetovenDBContext(); AppDbContext = new ApplicationDbContext(); }