Update README.md

This commit is contained in:
dlebee 2021-08-11 17:14:26 -04:00 committed by GitHub
parent a482f594e6
commit 1eb484ce88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,4 +64,17 @@ private void AddQueries(IServiceCollection services)
services.AddQuery<PersonQuery, IQueryable<Person>, PersonQueryHandler>();
}
```
# Fluent Validation
We use fluent validation in all of our projects, but we don't want it to be enforced.
If you install. ```PoweredSoft.CQRS.FluentValidation``` you can use this way of registrating your commands.
```chsarp
// without Package.
services.AddCommand<EchoCommand, string, EchoCommandHandler>();
services.AddTransient<IValidator<EchoCommand>, EchoCommandValidator>();*/
// with PoweredSoft.CQRS.FluentValidation package.
services.AddCommandWithValidator<EchoCommand, string, EchoCommandHandler, EchoCommandValidator>();
```