Beispiel #1
0
        private void UnionRelatedProperties(LambdaExpression[] baseRelatedProperties)
        {
            if (baseRelatedProperties?.Any() != true)
            {
                RelatedProperties = InnerValidator.RelatedProperties;
            }
            else
            {
                var relatedProperties = new HashSet <string>();
                foreach (var expression in baseRelatedProperties)
                {
                    var propertyName = ReactiveValidationHelper.GetPropertyName(typeof(TObject), expression);
                    if (string.IsNullOrEmpty(propertyName) == false)
                    {
                        relatedProperties.Add(propertyName);
                    }
                }

                foreach (var relatedProperty in InnerValidator.RelatedProperties)
                {
                    relatedProperties.Add(relatedProperty);
                }

                RelatedProperties = relatedProperties;
            }
        }
Beispiel #2
0
        private void UnionRelatedProperties(LambdaExpression[] baseRelatedProperties)
        {
            var relatedProperties = new HashSet <string>();

            if (baseRelatedProperties != null)
            {
                foreach (var expression in baseRelatedProperties)
                {
                    var propertyName = ReactiveValidationHelper.GetPropertyName(typeof(TObject), expression);
                    if (string.IsNullOrEmpty(propertyName) == false)
                    {
                        relatedProperties.Add(propertyName);
                    }
                }
            }

            foreach (var innerValidator in _innerValidators)
            {
                foreach (var innerValidatorRelatedProperty in innerValidator.RelatedProperties)
                {
                    relatedProperties.Add(innerValidatorRelatedProperty);
                }
            }

            RelatedProperties = relatedProperties;
        }
        private void AddRelatedProperties(LambdaExpression[] relatedProperties)
        {
            if (relatedProperties?.Any() != true)
            {
                return;
            }

            foreach (var expression in relatedProperties)
            {
                var propertyName = ReactiveValidationHelper.GetPropertyName(typeof(TObject), expression);
                if (string.IsNullOrEmpty(propertyName) == false)
                {
                    _relatedProperties.Add(propertyName);
                }
            }
        }