public ActionResult AssignUsersToProj(ProjUsersViewModel model) { //if (ModelState.IsValid) var project = db.Projects.Find(model.Project.Id); ProjectHelper helper = new ProjectHelper(db); foreach (var users in db.Users.Select(u => u.Id).ToList()) //"users" or "project"?? { helper.RemoveUserFromProj(users, project.Id); } if (model.Selected != null) { foreach (var users in model.Selected) //"users" or "project"?? { helper.AddUserToProj(users, project.Id); } } return(RedirectToAction("Index", "Projects")); //return View(); }