示例#1
0
文件: Role.cs 项目: AsliMotor/AMQ
        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;
        }
示例#2
0
文件: Role.cs 项目: AsliMotor/AMQ
 internal void AddUserRole(UserRole userRole)
 {
     _userRoles.Add(userRole);
 }