protected virtual void ValidateRights(IEnumerable <AccessRights> value) { if (value == null || !value.Any <AccessRights>() || value.Count <AccessRights>() > 3) { throw new ArgumentException(SRClient.NullEmptyRights(3)); } if (!AuthorizationRule.AreAccessRightsUnique(value)) { throw new ArgumentException(SRClient.CannotHaveDuplicateAccessRights); } }
internal void Validate() { if (this.Rights == null || !this.Rights.Any <AccessRights>() || this.Rights.Count <AccessRights>() > 3) { throw new InvalidDataContractException(SRClient.NullEmptyRights(3)); } if (!AuthorizationRule.AreAccessRightsUnique(this.Rights)) { throw new InvalidDataContractException(SRClient.CannotHaveDuplicateAccessRights); } this.OnValidate(); }