public HomeController(VacantionContext context, UserManager <User> userManager,
                       SignInManager <User> signInManager, RoleManager <Role> roleManager)
 {
     _context       = context;
     _userManager   = userManager;
     _signInManager = signInManager;
     _roleManager   = roleManager;
     foreach (var role in roles)
     {
         if (!_roleManager.Roles.Any(x => x.Name == role))
         {
             _context.Add(new Role()
             {
                 Name = role, NormalizedName = role.ToUpper()
             });
             _context.SaveChanges();
         }
     }
     if (!_context.Teams.Any(x => x.TeamName == "-"))
     {
         _context.Add(new Team()
         {
             TeamName = "-"
         });
         _context.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public RolesController(VacantionContext context, UserManager <User> userManager,
                        RoleManager <Role> roleManager, SignInManager <User> signInManager)
 {
     _context       = context;
     _userManager   = userManager;
     _roleManager   = roleManager;
     _signInManager = signInManager;
 }
Ejemplo n.º 3
0
 public ProjectsController(VacantionContext context)
 {
     _context = context;
 }
 public TeamsController(VacantionContext context)
 {
     _context = context;
 }