Skip to content

Add IProjection support in CompositeProjection#4140

Merged
jeremydmiller merged 1 commit intomasterfrom
use-projection-in-composite
Feb 16, 2026
Merged

Add IProjection support in CompositeProjection#4140
jeremydmiller merged 1 commit intomasterfrom
use-projection-in-composite

Conversation

@jeremydmiller
Copy link
Member

Summary

  • Adds Add(IProjection, int) overload to CompositeProjection so custom IProjection implementations can participate in composite projections
  • Uses a composite-safe wrapper (CompositeIProjectionSource / CompositeIProjectionExecution) instead of ProjectionWrapper, which would incorrectly dispose the shared batch via ProjectionExecution's unconditional await using pattern
  • Adds end-to-end tests for both the Trip and TeleHealth composite projections exercising the new overload

Test plan

  • TripMetricsProjection (custom IProjection) added to Trip composite test — verifies documents are produced
  • AppointmentMetricsProjection (custom IProjection) added to TeleHealth composite test — verifies specialty-grouped counts
  • Both single-tenant and conjoined tenancy modes pass
  • Existing composite projection behavior unchanged

🤖 Generated with Claude Code

Custom IProjection implementations can now be added directly to a
composite via the new Add(IProjection, int) overload. This uses a
composite-safe wrapper (CompositeIProjectionSource) instead of the
standard ProjectionWrapper, which would incorrectly dispose the shared
batch through ProjectionExecution's unconditional await using pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit aaa1d25 into master Feb 16, 2026
6 checks passed
@jeremydmiller jeremydmiller deleted the use-projection-in-composite branch February 16, 2026 18:43
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