public UserRole AddUser(Users user) { user.ReportIfNull("Argument AddUser(user)"); if (_userRoles.Contains(ur => ur.UserId.Equals(user.Id))) throw new Exception(String.Format("User {0} is already in {1}", user.Name, this.Name)); var userRole = new UserRole(user, this); _userRoles.Add(userRole); return userRole; }
internal void AddUserRole(UserRole userRole) { _userRoles.Add(userRole); }