protected internal override void DoValidate(object objectToValidate, object currentTarget, string key, ValidationResults validationResults) { bool isValid = false; if (objectToValidate != null) { RangeChecker <int> checker = new RangeChecker <int>(this.lowerBound, this.upperBound); isValid = checker.IsInRange((int)objectToValidate); } if (isValid == false) { RecordValidationResult(validationResults, this.MessageTemplate, currentTarget, key); } }
protected override void DoValidate(object objectToValidate, object currentTarget, string key, ValidationResults validationResults) { bool isValid = false; if (objectToValidate != null) { RangeChecker <int> checker = new RangeChecker <int>(this.lowerBound, this.upperBound); isValid = checker.IsInRange(Encoding.Default.GetByteCount(objectToValidate.ToString())); } if (isValid == false) { RecordValidationResult(validationResults, this.MessageTemplate, currentTarget, key); } }