public DefaultUser(UserManager <AppUser> userManager, RoleManager <IdentityRole> roleManager, BaselDbContext baselDbContext) { _userManager = userManager; _roleManager = roleManager; }
public async Task SetDefaultUser(IServiceScope serviceScope, BaselDbContext _baselDb) { if (!_baselDb.Users.Any()) { using (var RoleManager = serviceScope.ServiceProvider.GetRequiredService <RoleManager <IdentityRole> >()) { using (var UserManager = serviceScope.ServiceProvider.GetRequiredService <UserManager <AppUser> >()) { bool IsHasRole = await RoleManager.RoleExistsAsync("Admin"); if (!IsHasRole) { IdentityRole.Name = "Admin"; await RoleManager.CreateAsync(IdentityRole); AppUser appUser = new AppUser() { UserName = "******", Email = "*****@*****.**" }; await UserManager .CreateAsync(appUser, "Nicat12345@"); await UserManager.AddToRoleAsync(appUser, "Admin"); } } } } }
public AccountController(BaselDbContext baselDb, SignInManager <AppUser> signInManager, UserManager <AppUser> userManager) { _baselDb = baselDb; _signInManager = signInManager; _userManager = userManager; }
public HomeController(BaselDbContext baselDb, SignInManager <AppUser> signInManager, UserManager <AppUser> userManager, IHostingEnvironment hostingEnvironment) { _baselDb = baselDb; _signInManager = signInManager; _userManager = userManager; _hostingEnvironment = hostingEnvironment; }
public ConnectHomeViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public ColorController(BaselDbContext baselDb) { _baselDb = baselDb; }
public HomeSocialAccountViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public HeadMenuViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public UserViewComponent(BaselDbContext baselDbContext, UserManager <AppUser> roleManager) { _baselDbContext = baselDbContext; _userManager = roleManager; }
public LatestNewsViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public ShopMenuViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public CartController(BaselDbContext baselDb, UserManager <AppUser> userManager) { _baselDb = baselDb; _userManager = userManager; }
public AdminDashboardViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public ProductController(BaselDbContext baselDb) { _baselDb = baselDb; }
public CategoryController(BaselDbContext baselDb) { _baselDb = baselDb; }
public HomeController(BaselDbContext baselDb) { _baselDb = baselDb; }
public FeatureCategoryViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public UserStore(BaselDbContext context) { Context = context; }
public AccountMenuViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public MenuNavViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public RelateProductViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public ProductOptionViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public PageAboutViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public SlideController(BaselDbContext baselDb) { _baselDb = baselDb; }
public SlideViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public BaselLogoViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public ProductCategoryViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }
public FooterMenuViewComponent(BaselDbContext baselDbContext) { _baselDbContext = baselDbContext; }