Пример #1
0
 static PropertyValidatorDatabase()
 {
     validatorsByAttributeType = new Dictionary <Type, PropertyValidator>();
     validatorsByAttributeType[typeof(MinValueAttribute)]      = new MinValuePropertyValidator();
     validatorsByAttributeType[typeof(ValidateInputAttribute)] = new ValidateInputPropertyValidator();
     validatorsByAttributeType[typeof(MaxValueAttribute)]      = new MaxValuePropertyValidator();
     validatorsByAttributeType[typeof(RequiredAttribute)]      = new RequiredPropertyValidator();
 }
Пример #2
0
 static ValidatorAttributeExtensions()
 {
     _validatorsByAttributeType = new Dictionary <Type, PropertyValidatorBase>();
     _validatorsByAttributeType[typeof(MinValueAttribute)]      = new MinValuePropertyValidator();
     _validatorsByAttributeType[typeof(MaxValueAttribute)]      = new MaxValuePropertyValidator();
     _validatorsByAttributeType[typeof(RequiredAttribute)]      = new RequiredPropertyValidator();
     _validatorsByAttributeType[typeof(ValidateInputAttribute)] = new ValidateInputPropertyValidator();
 }