You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/configuration.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Configuration Options
2
2
3
+
::: tip You Probably Don't Need This
4
+
Foundatio Mediator works out of the box with sensible defaults — most projects never need to configure anything beyond `services.AddMediator()`. Only reach for the options below when you want to change a specific default behavior.
5
+
:::
6
+
3
7
Foundatio Mediator provides two types of configuration: **compile-time configuration** via the `[assembly: MediatorConfiguration]` attribute that controls source generator behavior, and **runtime configuration** via the `AddMediator()` method that controls mediator behavior.
That's it. No interfaces, no base classes, no registration — the source generator handles everything at compile time with near-direct-call performance.
54
54
55
+
::: tip Zero Configuration Required
56
+
The defaults are optimized for the most common use cases. You do **not** need `[assembly: MediatorConfiguration]` — it exists only as an escape hatch when you want to change a specific default behavior. See [Configuration](./configuration) for the full list of options.
57
+
:::
58
+
55
59
## Async Handlers
56
60
57
61
Handlers can be async and accept additional parameters resolved from DI:
@@ -108,6 +112,19 @@ HTTP methods, routes, and parameter binding are all inferred from message names
108
112
app.MapMyAppEndpoints(logEndpoints: true);
109
113
```
110
114
115
+
Need to customize a specific endpoint? Use the `[HandlerEndpoint]` attribute:
See [Endpoints](./endpoints) for route customization, OpenAPI metadata, authorization, and more.
112
129
113
130
## Result Types
@@ -168,7 +185,16 @@ await foreach (var evt in mediator.SubscribeAsync<OrderCreated>(cancellationToke
168
185
}
169
186
```
170
187
171
-
This is ideal for streaming endpoints where each client needs its own live feed. See [Dynamic Subscriptions](./streaming-handlers#dynamic-subscriptions-with-subscribeasync) for the full API.
188
+
Subscribe to **all** published notifications at once using `INotification`:
You can also subscribe to a custom marker interface (e.g., `IDispatchToClient`) to receive a targeted subset — no bridging layer or relay pipeline needed. See [Dynamic Subscriptions](./streaming-handlers#dynamic-subscriptions-with-subscribeasync) for the full API.
Copy file name to clipboardExpand all lines: docs/guide/handler-conventions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ public class OrderProcessor { }
107
107
```
108
108
109
109
::: tip Use Handler for Everything
110
-
Unlike some libraries that distinguish between "handlers" and "consumers," Foundatio Mediator treats both identically. The `Consumer` suffix exists purely to ease migration from libraries like MassTransit. For new projects, use `Handler` consistently for commands, queries, and events alike.
110
+
Unlike some libraries that distinguish between "handlers" and "consumers," Foundatio Mediator treats both identically. The `Consumer` suffix exists purely to ease migration from other mediator and message bus libraries. For new projects, use `Handler` consistently for commands, queries, and events alike.
0 commit comments