public static OptionalMessagePropertyValidationContext <string> NotNullOrEmpty( this PropertyValidationContext <string> context) { return(context.BeginPredicate( v => !string.IsNullOrEmpty(v), () => $"{context._currentRuleset.PropExpr.GetPropertyName()} must not be empty." )); }
public static OptionalMessagePropertyValidationContext <string> MaxLength( this PropertyValidationContext <string> context, int bound) { return(context.BeginPredicate( v => v == null || v.Length <= bound, () => $"{context._currentRuleset.PropExpr.GetPropertyName()} may be at most {bound} characters long." )); }