public ActionResult AssignToProject(string userId, int projectId) { var user = db.Users.Find(userId); var project = db.Projects.Find(projectId); ph.CheckUserId(user.Id); if (!ph.isUserOnProject(userId, projectId)) { ph.assignToProject(userId, projectId); } return(RedirectToAction("Index")); }