public async Task SeedAsync(TicketMasterDbContext dbContext, IServiceProvider serviceProvider) { var roleManager = serviceProvider.GetRequiredService <RoleManager <IdentityRole> >(); var userManager = serviceProvider.GetRequiredService <UserManager <User> >(); await SeedRolesAsync(roleManager, "Admin"); await SeedRolesAsync(roleManager, "Agent"); await SeedCompanyAsync(dbContext); await SeedUserWithRoleAdminAsync(userManager); await SeedUserWithRoleAgentAsync(userManager); }
private async Task SeedCompanyAsync(TicketMasterDbContext dbContext) { var company = dbContext.Companies.FirstOrDefault(c => c.Name == "GlobalInc"); if (company == null) { var result = dbContext.Companies.Add(new Company { Name = "GlobalInc", IsDeleted = false, }); await dbContext.SaveChangesAsync(); } }
public AdminCompanyService(TicketMasterDbContext dbContext) { this.dbContext = dbContext; }
public AgentTicketService(TicketMasterDbContext dbContext) { this.dbContext = dbContext; }
public AdminUserService(TicketMasterDbContext dbContext) { this.dbContext = dbContext; }
public UserHomeService(TicketMasterDbContext dbContext) { _dbContext = dbContext; }
public AdminProjectService(TicketMasterDbContext dbContext) { this.dbContext = dbContext; }
public ProjectController(IAdminProjectService service, TicketMasterDbContext dbContext) { this.service = service; }