Skip to content

Remove obsolete CarterModule - #388

Merged
jchannon merged 1 commit into
mainfrom
remove-carter-module
Nov 11, 2026
Merged

jchannon merged 1 commit into
mainfrom
remove-carter-module

Conversation

@jchannon

Copy link
Copy Markdown
Member

Stacked on #387.

CarterModule was marked [Obsolete] with the message "CarterModule will be removed in the next version. Please migrate to ICarterModule." This removes it.

  • Breaking: the CarterModule base class is gone, along with its module-wide settings (basePath, RequireAuthorization, RequireHost, RequireCors, WithTags, WithCacheOutput, RequireRateLimiting, Before/After, etc.).
  • MapCarter now just calls AddRoutes on every registered ICarterModule.
  • The DirectorsModule sample is converted to ICarterModule, using MapGroup("/directors") and an endpoint filter in place of the base path and Before/After hooks. This is the migration path for existing CarterModule users.
  • AuthorizationTests and AuthorizationTestModule are deleted: they only covered CarterModule.RequireAuthorization.
  • The CARTER2 analyzer (derived modules with constructor dependencies) is unchanged, since it applies to any class inheriting ICarterModule through a base class.

🤖 Generated with Claude Code

@jchannon jchannon added this to the vNext milestone Nov 11, 2026
@jchannon
jchannon added this pull request to stack #389 November 11, 2026 14:46
Base automatically changed from dotnet-11 to main November 11, 2026 14:47
CarterModule was marked obsolete with a notice that it would be removed
in the next version. Remove it, so MapCarter now simply calls AddRoutes
on every ICarterModule. Module-wide settings such as a base path,
authorization or before/after hooks are expressed with MapGroup and
endpoint filters inside AddRoutes, as the Directors sample now shows.

Co-Authored-By: Claude <noreply@anthropic.com>
@jchannon
jchannon force-pushed the remove-carter-module branch from f192613 to 867df3a Compare November 11, 2026 14:47
@jchannon
jchannon merged commit cf9004b into main Nov 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant