Show HN: PipelinePlus – plug-and-play MediatR pipeline behaviors for .NET

github.com

2 points by ilkanozbek 8 hours ago

PipelinePlus bundles common MediatR pipeline behaviors into a small, plug-and-play library to reduce boilerplate in .NET apps.

What’s included: - Validation (FluentValidation) - Caching (attribute-driven with opt-out) - Idempotency (deduplicate command handling) - Outbox (persist and dispatch events) - Performance (timing hooks) - Exception mapping (turn exceptions into consistent results/logs)

Motivation: In most MediatR projects, these cross-cutting concerns get reimplemented again and again. PipelinePlus aims to make them composable, testable, and easy to adopt without locking you in.

Install: dotnet add package PipelinePlus

Minimal usage: // Program.cs / composition root services.AddMediatR(typeof(Program)); services.AddPipelinePlus(); // registers the behaviors

  // Example request
  [Idempotent]
  public record CreateOrder(Guid Id, string Sku) : IRequest<Result>;

  // Example validator (FluentValidation)
  public class CreateOrderValidator : AbstractValidator<CreateOrder> {
    public CreateOrderValidator() {
      RuleFor(x => x.Sku).NotEmpty();
    }
  }
Notes: - Outbox/Idempotency plug into your own storage abstractions. - Works on .NET 8/9 and latest MediatR. - MIT licensed.

Repo: https://github.com/ilkanozbek/PipelinePlus Feedback welcome—API shape, naming, and ideas for the next behaviors (e.g., OpenTelemetry integration, Redis/distributed cache helpers).