Пример #1
0
        public void CreateValidator()
        {
            if (ValidationType == null)
            {
                _validator = ValidatorRegistry.DefaultValidator;
                return;
            }

            var type = ValidatorRegistry.GetValidator(ValidationType);

            try
            {
                _validator = (ConfigurationValidatorBase)Activator.CreateInstance(
                    type,
                    BindingFlags.CreateInstance | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public,
                    null,
                    ValidationParameter == null ? null : new object[] { ValidationParameter },
                    CultureInfo.InvariantCulture);
            }
            catch (MissingMethodException)
            {
                RollbarLocator.RollbarInstance.Error($"type: {ValidationType}; parameter: {ValidationParameter}; is null ? {ValidationParameter == null}");
                throw;
            }
        }
        public void CreateValidator()
        {
            if (ValidationType == null)
            {
                _validator = ValidatorRegistry.DefaultValidator;
                return;
            }

            var type = ValidatorRegistry.GetValidator(this.ValidationType);

            _validator = (ConfigurationValidatorBase)Activator.CreateInstance(
                type,
                BindingFlags.CreateInstance | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public,
                null,
                ValidationParameter == null ? null : new object[] { this.ValidationParameter },
                CultureInfo.InvariantCulture);
        }
        public void CreateValidator()
        {
            if (ValidationType == null)
            {
                _validator = ValidatorRegistry.DefaultValidator;
                return;
            }

            var type = ValidatorRegistry.GetValidator(this.ValidationType);
            _validator = (ConfigurationValidatorBase)Activator.CreateInstance(
                type,
                BindingFlags.CreateInstance | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public,
                null,
                ValidationParameter == null ? null : new object[] { this.ValidationParameter },
                CultureInfo.InvariantCulture);
        }