event-handler
CommunityIdempotent, ordered event handlers for queries
System Documentation
What problem does it solve?
Query-side projections in event-driven .NET systems must process events in order and tolerate duplicates; without clear patterns handlers can produce inconsistent read models, lost updates, or unnecessary retries.
Core Features & Use Cases
- Idempotent creations: creation handlers detect existing entities and return success to avoid duplicate processing.
- Strict sequence validation: update handlers enforce sequence == event.Sequence - 1 to detect gaps and out-of-order delivery and return appropriate completion or retry signals.
- Unit of Work and named repositories: encourages IUnitOfWork with named repository properties and cancellation-aware persistence to ensure consistent commits.
- Message-level return semantics: handlers return boolean to indicate completion (true) or retry/abandon (false), suitable for Service Bus or queue-based retry policies.
- Use Case: building reliable query projections for Orders and Products that survive duplicates, replays, and eventual delivery ordering.
Quick Start
Implement an event handler that returns true for already processed or successfully applied events, returns false when prior events are missing, uses IUnitOfWork with named repositories, performs strict sequence checks before applying behavior, and calls SaveChangesAsync with the provided cancellation token.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: event-handler Download link: https://github.com/FaysilAlshareef/dotnet-ai-kit/archive/main.zip#event-handler Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.