private void AddArrayValidatorIfNeeded(List <IValidator> validators) { if (FieldType.Equals(TweezersFieldType.Array)) { if (this.ArrayFieldProperties != null) { validators.Add(ArrayValidator.Create(ArrayFieldProperties)); } else { throw new ArgumentException($"ArrayFieldProperties are required for 'array' type"); } } }
private void AddTagsValidatorIfNeeded(List <IValidator> validators) { if (FieldType.Equals(TweezersFieldType.TagsArray)) { TweezersFieldProperties tagsFieldProperties = new TweezersFieldProperties() { FieldType = TweezersFieldType.String, Min = 1, Max = 50, Regex = $"^[A-Za-z\\d ]+$", }; validators.Add(ArrayValidator.Create(tagsFieldProperties)); } }