public PropertyValidatorContext(ValidationContext parentContext, PropertyRule rule, string propertyName)
 {
     ParentContext          = parentContext;
     Rule                   = rule;
     PropertyName           = propertyName;
     propertyValueContainer = new Lazy <object>(() => rule.PropertyFunc(parentContext.InstanceToValidate));
 }
 public PropertyValidatorContext(ValidationContext parentContext, PropertyRule rule, string propertyName)
 {
     ParentContext = parentContext;
     Rule          = rule;
     PropertyName  = propertyName;
     PropertyValue = rule.PropertyFunc(parentContext.InstanceToValidate);
 }
 public PropertyValidatorContext(ValidationContext parentContext, PropertyRule rule, string propertyName)
 {
     ParentContext = parentContext;
     Rule = rule;
     PropertyName = propertyName;
     propertyValueContainer = new Lazy<object>(() => rule.PropertyFunc(parentContext.InstanceToValidate));
 }
示例#4
0
		public PropertyValidatorContext(ValidationContext parentContext, PropertyRule rule, string propertyName) {
			ParentContext = parentContext;
			Rule = rule;
			PropertyName = propertyName;
			_propertyValueContainer = new Lazy<object>( () => {
				var value = rule.PropertyFunc(parentContext.InstanceToValidate);
				if (rule.Transformer != null) value = rule.Transformer(value);
				return value;
			});
		}