|
1 | 1 | # PosInformatique.FluentValidation.Json |
2 | 2 | [PosInformatique.FluentValidation.Json](https://www.nuget.org/packages/PosInformatique.FluentValidation.Json/) |
3 | | -is a library based on FluentValidation to validate JSON objects for the Web API. |
| 3 | +is a library based on [FluentValidation](https://docs.fluentvalidation.net/) to validate JSON objects for the Web API. |
4 | 4 |
|
5 | | -By default, when using the [FluentValidation](https://www.nuget.org/packages/FluentValidation) |
| 5 | +[](https://www.nuget.org/packages/PosInformatique.FluentValidation.Json/) |
| 6 | + |
| 7 | +By default, when using the [FluentValidation](https://docs.fluentvalidation.net/) |
6 | 8 | library to validate an object, the property name (or related display name) are used in the error message. |
7 | 9 | This can be useful for functional validation to display to users on the views of the application. |
8 | 10 |
|
@@ -41,7 +43,7 @@ public class Product |
41 | 43 | ``` |
42 | 44 |
|
43 | 45 | If you want to validate the C# `Product` class, you have to create a validator |
44 | | -which inherit from the `AbstractValidator<T>` class. |
| 46 | +which inherit from the `AbstractValidator<T>` class of [FluentValidation](https://docs.fluentvalidation.net/) library. |
45 | 47 |
|
46 | 48 | ```csharp |
47 | 49 | public class ProductValidator : AbstractValidator<Product> |
@@ -159,7 +161,7 @@ Next, you use your own validation strategy depending of the context usage. |
159 | 161 | For example, if you ASP .NET Core to create an Web API, you can use the following code |
160 | 162 | and returns an error as JSON problem format: |
161 | 163 |
|
162 | | -```json |
| 164 | +```csharp |
163 | 165 | [ApiController] |
164 | 166 | [Route("[controller]")] |
165 | 167 | public class ProductController : ControllerBase |
|
0 commit comments