Skip to content

[jasperfx] Additive IEventRegistry generic DIMs: AddEventType<T>() and EventMappingFor<T>() (P3.2a) #5114

Description

@jeremydmiller

Part of #5110. Target repo: JasperFx/jasperfx (tracked here per program convention; the actual PR lands there and rides a routine version bump into Marten and Polecat).

Add default interface methods to JasperFx.Events.IEventRegistry (src/JasperFx.Events/IEventRegistry.cs):

void AddEventType<T>() => AddEventType(typeof(T));
IEventType EventMappingFor<T>() => EventMappingFor(typeof(T));

Why: today only the non-generic forms are shared. Marten's EventMappingFor<T>() is internal (reachable only via InternalsVisibleTo — the compliance library has a zero-IVT rule) and returns EventMapping; Polecat's public override takes Type and returns PolecatEventType. Both concrete types implement IEventType, so the DIM unifies the assertion surface (.EventTypeName) for all test code in both repos, not just the compliance suites.

Non-breaking: DIMs only; existing store-specific members are unaffected (Marten's internal generic can later be retired independently).

Sequencing: not a hard blocker for P3.1 (the seam can call the Type-based forms), but landing it before P3.3 extraction lets the shared sources use the generic forms directly.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions