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
Build completely message-oriented, loosely coupled .NET apps that are easy to test — with near-direct-call performance and zero boilerplate. Powered by source generators and interceptors.
8
+
Foundatio Mediator is a high-performance mediator library for .NET that uses source generators and C# interceptors to achieve near-direct-call performance with zero runtime reflection. Build completely message-oriented, loosely coupled apps that are easy to test — with zero boilerplate.
> **Prefer explicit interfaces?** Use `IHandler` marker interface or `[Handler]` attributes instead. See [Handler Conventions](https://mediator.foundatio.dev/guide/handler-conventions.html#explicit-handler-declaration).
57
-
58
-
## 🚀 Quick Start
26
+
## 🚀 Get Started
59
27
60
28
```bash
61
29
dotnet add package Foundatio.Mediator
62
30
```
63
31
64
-
```csharp
65
-
// Program.cs
66
-
varbuilder=WebApplication.CreateBuilder(args);
67
-
builder.Services.AddMediator();
68
-
varapp=builder.Build();
69
-
app.MapMyAppEndpoints(); // generated — see "Auto-Generate API Endpoints" below
70
-
app.Run();
71
-
```
72
-
73
-
That's it for setup. Now define messages and handlers:
32
+
**👉 [Getting Started Guide](https://mediator.foundatio.dev/guide/getting-started.html)** — step-by-step setup with code samples for ASP.NET Core and console apps.
74
33
75
-
```csharp
76
-
// Messages (records, classes, anything)
77
-
publicrecordGetUser(intId);
78
-
publicrecordCreateUser(stringName, stringEmail);
79
-
publicrecordUserCreated(intUserId, stringEmail);
80
-
81
-
// Handlers - just plain classes ending with "Handler" or "Consumer"
HTTP methods, routes, and parameter binding are inferred from message names and properties. `Result<T>` maps to the correct HTTP status codes automatically. Pass `logEndpoints: true` to see all mapped routes at startup:
163
-
164
-
```csharp
165
-
app.MapProductsEndpoints(logEndpoints: true);
166
-
```
167
-
168
-
See [Endpoints Guide](https://mediator.foundatio.dev/guide/endpoints.html) for route customization, OpenAPI metadata, authorization, and more.
After building, check the `Generated` folder for handler wrappers, DI registrations, and interceptor code. See [Troubleshooting](https://mediator.foundatio.dev/guide/troubleshooting.html) for more details.
214
-
215
49
## 📦 CI Packages (Feedz)
216
50
217
51
Want the latest CI build before it hits NuGet? Add the Feedz source (read‑only public) and install the pre-release version:
Copy file name to clipboardExpand all lines: docs/guide/getting-started.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,9 +105,7 @@ This generates:
105
105
106
106
<!---->
107
107
108
-
HTTP methods, routes, and parameter binding are all inferred from message names and properties. Pass `logEndpoints: true` to see all mapped routes at startup:
109
-
110
-
See [Endpoints](./endpoints) for route customization, OpenAPI metadata, authorization, and more.
108
+
HTTP methods, routes, and parameter binding are all inferred from message names and properties. See [Endpoints](./endpoints) for route customization, OpenAPI metadata, authorization, and more.
0 commit comments