New Now available on NuGet

Send a command.
Everything else runs around it.

MediCore is a lightweight CQRS mediator for .NET. Validation, logging and transactions run as interceptors, so your handlers only contain business logic.

$dotnet add package MediCore
NuGet version NuGet downloads MIT license .NET 8

The plumbing you keep rewriting, built in

MediCore gives you the mediator pattern and the cross-cutting pieces that usually come with it.

Request interceptors

Wrap every request with reusable steps. Turn on logging, validation and transactions once, and every command and query gets them.

LoggingValidationTransactions

Notifications

Publish an event once and let any number of handlers react to it.

Service registry

Register handlers and interceptors in one place, with the standard .NET dependency injection you already use.

Small, focused interfaces

Commands, queries, notifications and interceptors each have their own interface. Your code says what it does, and swapping or testing a piece stays simple.

Modern .NET

Built for .NET 8 with nullable reference types and XML docs, so IntelliSense explains each type as you type.

Light to adopt

It only depends on the Microsoft.Extensions abstractions for dependency injection and logging. No extra frameworks to pull in.

Running in three steps

Register MediCore, write a command and handler, then add an interceptor.

Program.cs
using MediCore;

var builder = WebApplication.CreateBuilder(args);

// Scan this assembly for handlers and interceptors
builder.Services.AddMediCore(options =>
{
    options.RegisterHandlersFromAssemblyContaining<Program>();
    options.AddDefaultInterceptors();
    options.UseTransactionManager<MyEfTransactionManager>(); // optional — defaults to TransactionScopeManager
});

var app = builder.Build();
app.Run();

Built in the open

MediCore is open source and created by Varun Kumar A, a software engineer working with .NET and Angular. Questions, ideas and feedback are always welcome.

Try MediCore in your next project

Install it, send your first command, and tell us what you think. Feedback and issues on GitHub are very welcome.

$dotnet add package MediCore
Copied