From b007a1d258d99b3e9af756be33ea1ff636b9af40 Mon Sep 17 00:00:00 2001 From: Jeremy Skinner <90130+JeremySkinner@users.noreply.github.com> Date: Thu, 26 May 2022 13:00:03 +0100 Subject: [PATCH] Document ComparisonProperty placeholder --- docs/built-in-validators.md | 6 ++++++ docs/configuring.md | 1 + 2 files changed, 7 insertions(+) diff --git a/docs/built-in-validators.md b/docs/built-in-validators.md index ad34a8333..97d45de0f 100644 --- a/docs/built-in-validators.md +++ b/docs/built-in-validators.md @@ -45,6 +45,7 @@ Example error: *'Surname' should not be equal to 'Foo'* String format args: * `{PropertyName}` – Name of the property being validated * `{ComparisonValue}` – Value that the property should not equal +* `{ComparisonProperty}` – Name of the property being compared against (if any) * `{PropertyValue}` – Current value of the property Optionally, a comparer can be provided to ensure a specific type of comparison is performed: @@ -80,6 +81,7 @@ Example error: *'Surname' should be equal to 'Foo'* String format args: * `{PropertyName}` – Name of the property being validated * `{ComparisonValue}` – Value that the property should equal +* `{ComparisonProperty}` – Name of the property being compared against (if any) * `{PropertyValue}` – Current value of the property ```csharp @@ -169,6 +171,7 @@ Notes: Only valid on types that implement `IComparable` String format args: * `{PropertyName}` – Name of the property being validated * `{ComparisonValue}` – Value to which the property was compared +* `{ComparisonProperty}` – Name of the property being compared against (if any) * `{PropertyValue}` – Current value of the property ## Less Than Or Equal Validator @@ -185,6 +188,7 @@ Example error: *'Credit Limit' must be less than or equal to 100.* Notes: Only valid on types that implement `IComparable` * `{PropertyName}` – Name of the property being validated * `{ComparisonValue}` – Value to which the property was compared +* `{ComparisonProperty}` – Name of the property being compared against (if any) * `{PropertyValue}` – Current value of the property ## Greater Than Validator @@ -201,6 +205,7 @@ Example error: *'Credit Limit' must be greater than 0.* Notes: Only valid on types that implement `IComparable` * `{PropertyName}` – Name of the property being validated * `{ComparisonValue}` – Value to which the property was compared +* `{ComparisonProperty}` – Name of the property being compared against (if any) * `{PropertyValue}` – Current value of the property ## Greater Than Or Equal Validator @@ -217,6 +222,7 @@ Example error: *'Credit Limit' must be greater than or equal to 1.* Notes: Only valid on types that implement `IComparable` * `{PropertyName}` – Name of the property being validated * `{ComparisonValue}` – Value to which the property was compared +* `{ComparisonProperty}` – Name of the property being compared against (if any) * `{PropertyValue}` – Current value of the property ## Predicate Validator diff --git a/docs/configuring.md b/docs/configuring.md index fafbdf577..4f84dd1a7 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -25,6 +25,7 @@ These include the predicate validator (`Must` validator), the email and the rege Used in comparison validators: (`Equal`, `NotEqual`, `GreaterThan`, `GreaterThanOrEqual`, etc.) * `{ComparisonValue}` – Value that the property should be compared to +* `{ComparisonProperty}` – Name of the property being compared against (if any) Used only in the Length validator: * `{MinLength}` – Minimum length