---
title: "Using MediatR with API Endpoints"
url: https://daily.dev/posts/using-mediatr-with-api-endpoints-ywhp5tcia
source_url: https://nodogmablog.bryanhogan.net/2022/10/using-mediatr-with-api-endpoints
type: article
source: "No Dogma Blog (Bryan Hogan)"
published: 2026-05-31T07:46:58.301Z
updated: 2026-05-31T08:47:23.509Z
tags: [".net", "dependency-injection"]
reading_time: 2
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Using MediatR with API Endpoints

**[No Dogma Blog \(Bryan Hogan\)](https://daily.dev/sources/bryanhogan)** · 2 min read · 0 upvotes · 0 comments

## Summary

A short tutorial showing how to integrate the MediatR library with .NET minimal API endpoints. It demonstrates registering MediatR with the DI container, defining a request and handler, and wiring them up so business logic stays out of the endpoint itself. Includes a simple working example that adds two numbers via a mediator-dispatched handler.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nodogmablog.bryanhogan.net/2022/10/using-mediatr-with-api-endpoints>

---

Tags: [#.net](https://daily.dev/tags/.net), [#dependency-injection](https://daily.dev/tags/dependency-injection)

[View this post on daily.dev](https://daily.dev/posts/using-mediatr-with-api-endpoints-ywhp5tcia)
