Browse Source

Update Validation.md

pull/5923/head
maliming 5 years ago
committed by GitHub
parent
commit
3c6b60d7be
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      docs/en/Validation.md

25
docs/en/Validation.md

@ -112,6 +112,29 @@ namespace Acme.BookStore
> ABP framework uses the [dynamic proxying / interception](Dynamic-Proxying-Interceptors.md) system to perform the validation. In order to make it working, your method should be **virtual** or your service should be injected and used over an **interface** (like `IMyService`).
#### Enabling/Disabling Validation
You can use the `[DisableValidation]` to disable it for methods, classs and properties.
````csharp
[DisableValidation]
public Void MyMethod()
{
}
[DisableValidation]
public class InputClass
{
public string MyProperty { get; set; }
}
public class InputClass
{
[DisableValidation]
public string MyProperty { get; set; }
}
````
### AbpValidationException
Once ABP determines a validation error, it throws an exception of type `AbpValidationException`. Your application code can throw `AbpValidationException`, but most of the times it is not needed.
@ -155,4 +178,4 @@ public class MyObjectValidationContributor
## FluentValidation Integration
Volo.Abp.FluentValidation package integrates the FluentValidation library to the validation system (by implementing the `IObjectValidationContributor`). See the [FluentValidation Integration document](FluentValidation.md) for more.
Volo.Abp.FluentValidation package integrates the FluentValidation library to the validation system (by implementing the `IObjectValidationContributor`). See the [FluentValidation Integration document](FluentValidation.md) for more.

Loading…
Cancel
Save