public async Task <IActionResult> Create(EmployeeRoleSelections employeeRoleSelections)
 {
     if (!employeeRoleSelections.roleSelections.Any(m => m.Selected))
     {
         ModelState.AddModelError("roleSelections", "You must select at least one role!");
     }
     if (_context.Employee.Any(e => e.UserName == employeeRoleSelections.employee.UserName))
     {
         ModelState.AddModelError("employee.UserName", "This user name already exists!");
     }
     if (ModelState.IsValid)
     {
         _context.Add(employeeRoleSelections.employee);
         _context.SaveChanges();
         foreach (RoleSelection roleSelection in employeeRoleSelections.roleSelections)
         {
             if (roleSelection.Selected)
             {
                 EmployeeRole employeeRole = new EmployeeRole {
                     RoleId = roleSelection.role.Id, EmployeeId = employeeRoleSelections.employee.Id
                 };
                 _context.EmployeeRole.Add(employeeRole);
             }
         }
         _context.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(employeeRoleSelections));
 }