Skip to content

V3/bugfix/221#230

Merged
eneshoxha merged 3 commits into
v3.2/releasefrom
v3/bugfix/221
Feb 24, 2026
Merged

V3/bugfix/221#230
eneshoxha merged 3 commits into
v3.2/releasefrom
v3/bugfix/221

Conversation

@eneshoxha
Copy link
Copy Markdown
Contributor

MediatorOptions.cs — Added AddQueryPipelineBehavior() method for closed generic query behaviors, matching the pattern that already exists for commands (AddCommandPipelineBehavior()) and
notifications (AddNotificationPipelineBehavior()). Validates that the type implements IQueryPipelineBehavior<,> and rejects open generics with a helpful error message.

ServiceCollectionExtensions.cs — Fixed query behavior DI registration to handle both open and closed generics. Previously it always registered against the open generic interface
IQueryPipelineBehavior<,>, which doesn't work for closed types. Now it mirrors the notification behavior logic: open generics register against the open interface, closed types register against their
specific implemented interfaces.

QueryBehaviorIntegrationTests.cs (new) — 10 tests covering:

  • Open generic registration and resolution
  • Closed generic registration and resolution
  • Closed constructed generic registration
  • Validation error cases (non-open-generic, non-behavior types)
  • End-to-end integration for open, closed, and combined behaviors

Updated .gitignore to exclude the MigrationBackup/ directory and its contents from version control, preventing accidental commits of backup files.
Update .gitignore to exclude any .claude file or directory from version control. This prevents accidental commits of files or folders named .claude.
…tion

Adds AddQueryPipelineBehavior<T> for registering closed (concrete) query pipeline behaviors alongside open generics. Updates DI registration logic to handle both open and closed behaviors correctly. Includes comprehensive integration tests for registration, execution, and error cases, improving flexibility and correctness of query pipeline behavior handling.
@eneshoxha eneshoxha added this to the Cortex v3.2 milestone Feb 24, 2026
@eneshoxha eneshoxha self-assigned this Feb 24, 2026
@eneshoxha eneshoxha added the bugfix This label is in use for patch version increments label Feb 24, 2026
@eneshoxha eneshoxha linked an issue Feb 24, 2026 that may be closed by this pull request
@eneshoxha eneshoxha merged commit 8cd61a9 into v3.2/release Feb 24, 2026
@eneshoxha eneshoxha deleted the v3/bugfix/221 branch February 24, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This label is in use for patch version increments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Missing Closed Generic Query Behavior Registration

1 participant