Movatterモバイル変換


[0]ホーム

URL:


ABP LogoABP Logo
Filter by title

No results found!

IObjectValidator is implemented by theObjectValidator by default.ObjectValidator is extensible; you can implementIObjectValidationContributor interface to contribute a custom logic. Example:

public class MyObjectValidationContributor    : IObjectValidationContributor, ITransientDependency{    public Task AddErrorsAsync(ObjectValidationContext context)    {        //Get the validating object        var obj = context.ValidatingObject;        //Add the validation errors if available        context.Errors.Add(...);        return Task.CompletedTask;    }}
  • Remember to register your class to theDI (implementingITransientDependency does it just like in this example)
  • ABP will automatically discover your class and use on any type of object validation (including automatic method call validation).

IMethodInvocationValidator

IMethodInvocationValidator is used to validate a method call. It internally uses theIObjectValidator to validate objects passes to the method call. You normally don't need to this service since it is automatically used by the framework, but you may want to reuse or replace it on your application in rare cases.

FluentValidation Integration

Volo.Abp.FluentValidation package integrates the FluentValidation library to the validation system (by implementing theIObjectValidationContributor). See theFluentValidation Integration document for more.

Contributors

Avatarhikalkan

Last updated: July 31, 2024Edit this page onGitHub

Was this page helpful?

Please make a selection.

To help us improve, please share your reason for the negative feedback in the field below.

Please enter a note.

Thank you for your valuable feedback!

Please note that although we cannot respond to feedback, our team will use your comments to improve the experience.

In this document
ABP Community Talks
The Easiest Way to Get Started with Microservices on .NET Using ABP Microservice Solution Template
24 Jul, 17:00
Online
Register Now
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book

[8]ページ先頭

©2009-2025 Movatter.jp