mediatorlite-sample-sourcegen

Generate canonical MediatorLite v2 source-generated dispatch setup for .NET 10+ projects.

4|1|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/behl1anmol/MediatorLite --skill mediatorlite-sample-sourcegen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mediatorlite-sample-sourcegen
Source: https://github.com/behl1anmol/MediatorLite/tree/main/.cursor/skills/mediatorlite-sample-sourcegen
Command: npx skills add https://github.com/behl1anmol/MediatorLite --skill mediatorlite-sample-sourcegen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the guesswork and manual registration errors developers face when setting up MediatorLite's source-generation-first dispatch model in new .NET 10+ projects, ensuring alignment with v2 best practices from the first line of code.

Core Features & Use Cases

  • Canonical DI wiring reference: Exact, copy-paste ready setup for AddGeneratedHandlers() and AddMediatorLite() with no manual handler, behavior, or validator registration required.
  • End-to-end pattern demonstrations: Covers open generic and closed pipeline behaviors, layered DataAnnotations plus custom business rule validation, and ordered multi-handler notifications.
  • Use case: Use this when building a new .NET console, web, or function app with MediatorLite, needing a trusted reference for project layout, source-gen feature usage, and common implementation patterns.

Quick Start

Use this skill to reference the correct project structure, DI registration steps, and implementation patterns for behaviors, validation, and notifications when building a new MediatorLite source-generation consumer application.

Frequently Asked Questions about mediatorlite-sample-sourcegen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up MediatorLite source generation in a .NET 10 application?

To set up MediatorLite source generation, use canonical dependency injection wiring with AddGeneratedHandlers() and AddMediatorLite(), eliminating manual handler, behavior, or validator registration in your .NET 10 projects.

How does MediatorLite handle pipeline behaviors with source generation?

MediatorLite handles pipeline behaviors through source generation by supporting both open generic and closed behavior composition, automatically wiring them into the dispatch pipeline without requiring manual dependency injection registration.

Can I layer DataAnnotations validation with custom validators in MediatorLite?

Yes, you can layer DataAnnotations validation with custom business rule validators in MediatorLite. The source-generation-first dispatch model aggregates both validation types within the pipeline behaviors to ensure comprehensive request validation.

Does MediatorLite source generation support ordered multi-handler notifications?

Yes, MediatorLite source generation supports ordered multi-handler notifications. It provides reference implementations for notification ordering to meet v2 best practice requirements across console, web, and function app projects.

What is the best way to avoid manual registration errors when adopting MediatorLite?

The best way to avoid manual registration errors is adopting MediatorLite's source-generation-first dispatch model, which automatically wires handlers, pipeline behaviors, and validators according to v2 best practices from project inception.

When do I need source generation for MediatorLite pipeline behaviors and notifications?

You need source generation for MediatorLite pipeline behaviors and notifications when building new .NET 10 console, web, or function apps requiring canonical wiring, layered validation, and ordered multi-handler notification dispatching.