protected override void Validate(List<ValidationResult> results, ResponseBase r) { base.Validate(results, r); if (!string.IsNullOrEmpty(PrimaryUse) && PrimaryUse != PrimaryUseType.Item002.ToString()) { if (CompanyName != null) { if (CompanyName.Length < 1 || CompanyName.Length > 90) r.ErrorList.Add(new LengthValidationFault("CompanyName", 1, 90)); else if (CompanyName.IndexOfAny(@".,;:-_*""".ToCharArray()) == 0) r.ErrorList.Add(new FormatValidationFault("CompanyName", "Cannot start with any of: .,;:-_*\"")); } else r.ErrorList.Add(new RequiredValidationFault("CompanyName")); } }