From 7fe73da6ac0a65b258145f80ed9f311115a1cdf4 Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Fri, 7 Jul 2023 14:37:57 -0500 Subject: [PATCH] Adjusting examples --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3f120af6..339e29c5 100644 --- a/README.md +++ b/README.md @@ -64,25 +64,26 @@ This registers: - `IRequestHandler<>` concrete implementations as transient - `INotificationHandler<>` concrete implementations as transient - `IStreamRequestHandler<>` concrete implementations as transient -- `IRequestPreProcessor<>` concrete implementations as transient -- `IRequestPostProcessor<,>` concrete implementations as transient - `IRequestExceptionHandler<,,>` concrete implementations as transient - `IRequestExceptionAction<,>)` concrete implementations as transient This also registers open generic implementations for: - `INotificationHandler<>` -- `IRequestPreProcessor<>` -- `IRequestPostProcessor<,>` - `IRequestExceptionHandler<,,>` - `IRequestExceptionAction<,>` -To register behaviors: +To register behaviors, stream behaviors, pre/post processors: ```csharp services.AddMediatR(cfg => { cfg.RegisterServicesFromAssembly(typeof(Startup).Assembly); - cfg.AddBehavior, PingPongBehavior>(); + cfg.AddBehavior(); + cfg.AddStreamBehavior(); + cfg.AddRequestPreProcessor(); + cfg.AddRequestPostProcessor(); cfg.AddOpenBehavior(typeof(GenericBehavior<,>)); }); ``` + +With additional methods for open generics and overloads for explicit service types.