Update README.md

This commit is contained in:
dlebee 2021-02-02 12:42:44 -05:00 committed by GitHub
parent 0e240a80ab
commit 73e3f6b8a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,4 +35,21 @@ public void ConfigureServices(IServiceCollection services)
services.AddSwaggerGen();
}
```
> Example how to add your queries and commands.
```csharp
private void AddCommands(IServiceCollection services)
{
services.AddCommand<CreatePersonCommand, CreatePersonCommandHandler>();
services.AddTransient<IValidator<CreatePersonCommand>, CreatePersonCommandValidator>();
services.AddCommand<EchoCommand, string, EchoCommandHandler>();
services.AddTransient<IValidator<EchoCommand>, EchoCommandValidator>();
}
private void AddQueries(IServiceCollection services)
{
services.AddQuery<PersonQuery, IQueryable<Person>, PersonQueryHandler>();
}
```