
MediatR is a popular library for implementing CQRS in .NET Core.
Pattern:
1. Define IRequest<TResponse> for commands/queries.
2. Implement IRequestHandler<TRequest, TResponse>.
3. Inject IMediator into controllers and send requests.
Benefits: Centralizes use case handling, reduces controller bloat, and supports cross-cutting behaviors via pipelines.
Architecture impact: MediatR helps enforce CQRS and Clean Architecture boundaries in large .NET Core solutions.
Reference:
TaskLoco™ — The Sticky Note GOAT