public RequiredIfAttribute(string dependentProperty, RequiredIfComparison comparison, object value) { if (string.IsNullOrEmpty(dependentProperty)) { throw new ArgumentNullException("dependentProperty"); } _dependentProperty = dependentProperty; _comparison = comparison; _value = value; }
public RequiredIfAttribute(string otherProperty, RequiredIfComparison comparison, object value) { if (string.IsNullOrEmpty(otherProperty)) { throw new ArgumentNullException("otherProperty"); } OtherProperty = otherProperty; Comparison = comparison; Value = value; }
public ModelClientValidationRequiredIfRule(string errorMessage, string dependentProperty, RequiredIfComparison comparison, object value, bool allowMultiple) { ErrorMessage = errorMessage; ValidationType = "requiredif"; ValidationParameters.Add("dependentprop", dependentProperty); ValidationParameters.Add("comparison", comparison.ToString().ToLower()); ValidationParameters.Add("value", value.ToString()); ValidationParameters.Add("allowmultiple", allowMultiple.ToString().ToLower()); }