ADR 0006: “Base-First” ASP.NET Controllers/Hubs with Minimal Routing Defaults

Status

Accepted — 2025-12-15

Context

ManagedCode.Storage aims to provide end-to-end HTTP and SignalR flows on top of IStorage, while still allowing host applications to fully control routing and authorization.

However, consumers often need to customize:

Problem

If the library ships only “final” controllers with fixed routes and behaviour:

Decision

We ship a “base-first” server integration:

flowchart LR
  App[ASP.NET app] --> Base[StorageControllerBase / StorageHubBase]
  Base --> Core[IStorage]
  Core --> Provider[Concrete provider]

Alternatives Considered

  1. Fixed controllers only
    • Pros: simplest surface; minimal classes.
    • Cons: poor customizability; forces consumers into a specific routing/auth model.
  2. Minimal API only
    • Pros: flexible; composable.
    • Cons: harder to ship a stable SDK surface; more code in consumer apps.
  3. Base-first controllers/hubs (chosen)
    • Pros: reusable logic + flexible customization; stable upgrade story.
    • Cons: more types; requires docs/examples so consumers understand inheritance points.

Consequences

Positive

Negative

References (Internal)