public StringLengthRule(int? minLength, int? maxLength) : base("StringLength") { if ((minLength == null) && (maxLength == null)) throw new ArgumentException("Specify minLength or maxLength or both"); MinLength = minLength; MaxLength = maxLength; }