//protected override void Seed(Smac.Data.SmacDbContext context) //{ // // This method will be called after migrating to the latest version. // var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new SmacDbContext())); // var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(new SmacDbContext())); // var user = new ApplicationUser() // { // UserName = "******", // Email = "*****@*****.**", // EmailConfirmed = true, // BirthDay = DateTime.Now, // FullName = "Nguyễn Hữu Thành" // }; // manager.Create(user, "123456"); // if (!roleManager.Roles.Any()) // { // roleManager.Create(new IdentityRole { Name = "Admin" }); // roleManager.Create(new IdentityRole { Name = "User" }); // } // var adminUser = manager.FindByEmail("*****@*****.**"); // manager.AddToRoles(adminUser.Id, new string[] { "Admin", "User" }); //} private void CreateProductCategorySample(SmacDbContext context) { List <ProductCategory> listProductCategory = new List <ProductCategory>(); }
public ApplicationUserStore(SmacDbContext context) : base(context) { }
public SmacDbContext Init() { return(dbContext ?? (dbContext = new SmacDbContext())); }