private void GenerateValueTypesRules(ValidationModel model, PropertyInfo nestedPropertyInfo, string prefix)
        {
            var valueTypeRuleMatches = _valueTypeMatchesFinder.GetMatches(nestedPropertyInfo.PropertyType);

            if (!valueTypeRuleMatches.Any())
            {
                return;
            }

            var property = _propertyResolver.GetPropertyName(prefix + nestedPropertyInfo.Name);
            var field    = model.GetOrCreateValidationProperty(property);

            foreach (var valueTypeRuleMatch in valueTypeRuleMatches)
            {
                var validationRule = _valueTypeRuleFactory.CreateRule(valueTypeRuleMatch);
                if (validationRule == null)
                {
                    continue;
                }
                if (!field.Rules.ContainsKey(validationRule.Name))
                {
                    field.Rules.Add(validationRule.Name, validationRule);
                }
            }
        }
        private void GenerateChildRules(ValidationModel model, Type validatorType, string prefix)
        {
            var validators = _validatorFactory.CreateValidator(validatorType);

            if (validators == null)
            {
                return;
            }

            foreach (var validatorRule in validators)
            {
                var propertyRule = validatorRule as PropertyRule;
                if (propertyRule?.PropertyName == null)
                {
                    continue;
                }

                var property = _propertyResolver.GetPropertyName(prefix + propertyRule.PropertyName);
                var field    = model.GetOrCreateValidationProperty(property);

                foreach (var propertyValidator in propertyRule.Validators)
                {
                    if (_validationRuleFactory.IsSupportedValidator(propertyValidator))
                    {
                        GenerateSingleRule(field, propertyValidator, propertyRule.Member.DeclaringType, prefix);
                    }
                    else if (_validationRuleFactory.IsChildCollectionValidator(propertyValidator))
                    {
                        var childCollectionValidator = propertyValidator as ChildValidatorAdaptor;
                        if (childCollectionValidator == null)
                        {
                            return;
                        }

                        GenerateChildRules(model, childCollectionValidator.ValidatorType, property.ToPrefix());
                    }
                }
            }
        }