You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/articles/features/data-validation.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,15 @@ title: Using the Data Validation package
5
5
6
6
# Using the Data Validation package
7
7
8
-
The Data Validation package is designed to provide out-of-the-box data validation to applications built with C#.
8
+
The Data Validation package is designed to provide out-of-the-box data validation to applications built with C#.
9
9
10
10
## Validating an object using the ValidatorCollection
11
11
12
12
Data validation can be implemented in so many different ways. MADE provides the capability to perform data validation through its own `IValidator` interface that can be used to create consistent data validators.
13
13
14
14
Using the `MADE.Data.Validation.ValidatorCollection` based on a `List` type, you can construct a collection of `IValidator` instances which can be used to validate values.
15
15
16
-
For example, you might want a collection of validators that ensure that a value is provided, it has a minimum length, and it contains only alphanumeric characters.
16
+
For example, you might want a collection of validators that ensure that a value is provided, it has a minimum length, and it contains only alphanumeric characters.
17
17
18
18
Instead of implementing your own custom validation in your application, you can take advantage of the built-in `IValidator` implementation of this package and utilize them with the `ValidatorCollection`.
19
19
@@ -102,15 +102,15 @@ The implementation splits the IP address into each nibble and validates them bas
102
102
103
103
### MaxValueValidator
104
104
105
-
The `MaxValueValidator` validates an `IComparable` value is less than a configurable maximum value.
105
+
The `MaxValueValidator` validates an `IComparable` value is less than a configurable maximum value.
106
106
107
107
The maximum can be configured by setting the `Max` value.
108
108
109
109
The in-box `System` types which implement the `IComparable` interface can be [found in the Microsoft documentation](https://docs.microsoft.com/en-us/dotnet/api/system.icomparable?view=net-5.0).
110
110
111
111
### MinValueValidator
112
112
113
-
The `MinValueValidator` validates an `IComparable` value is greater than a configurable minimum value.
113
+
The `MinValueValidator` validates an `IComparable` value is greater than a configurable minimum value.
114
114
115
115
The minimum can be configured by setting the `Min` value.
If there is a common data validator you think is missing from MADE.NET, [raise a tracking item on GitHub](https://github.com/MADE-Apps/MADE.NET/issues/new/choose) and we'll get it implemented.
194
+
195
+
## Using FluentValidation with MADE.NET
196
+
197
+
The `MADE.Data.Validation.FluentValidation` package provides an easy way to take advantage of validation with the [FluentValidation](https://fluentvalidation.net/) library validator framework.
198
+
199
+
### Validating an object using the FluentValidatorCollection
200
+
201
+
Using the `MADE.Data.Validation.FluentValidatorCollection<T>` based on a `List` type, you can construct a collection of `AbstractValidator` instances which can be used to validate values.
202
+
203
+
This way, you can bring FluentValidation's out-of-the-box validators or your own custom validators based on the `AbstractValidator` type and get all the benefits of using the existing MADE.NET validation framework. This is great for example with input validator controls that currently support the MADE.NET validation framework!
0 commit comments