Skip to content

SingleStreamProjection<TDoc, TId> + strongly-typed ID support, bump to 1.4.0#13

Merged
jeremydmiller merged 1 commit intomainfrom
projections/single-stream-toc-tid
Mar 24, 2026
Merged

SingleStreamProjection<TDoc, TId> + strongly-typed ID support, bump to 1.4.0#13
jeremydmiller merged 1 commit intomainfrom
projections/single-stream-toc-tid

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

  • Change SingleStreamProjection<TDoc> to SingleStreamProjection<TDoc, TId> to match Marten's signature
  • Add Snapshot<T, TId>() overloads on PolecatProjectionOptions and PolecatCompositeProjection (existing Snapshot<T>() defaults to Guid)
  • Fix nullable strongly-typed ID handling in DocumentMapping (unwrap Nullable<T> before ValueTypeInfo resolution)
  • Fix DocumentMapping.SetId to avoid double-wrapping when id is already the wrapper type
  • Fix PolecatProjectionStorage to properly unwrap/wrap strongly-typed IDs for SQL parameters and identity resolution
  • Update EventGraph live aggregation to pick Guid or string based on StreamIdentity configuration
  • Update EfCoreSingleStreamProjection to inherit SingleStreamProjection<TDoc, Guid>
  • Add StronglyTypedId 1.0.0-beta08 NuGet package to test project
  • Bump NuGet version to 1.4.0

Test plan

  • 6 new tests for SingleStreamProjection<TDoc, string> with string stream identity (inline projection, custom projection class, Snapshot API)
  • 5 new tests for Guid-based strongly-typed ID (PaymentId) — live aggregation, inline, explicit registration, FetchForWriting, async daemon
  • 5 new tests for string-based strongly-typed ID (Payment2Id) — same coverage as Guid-based
  • All existing projection tests pass (inline, live, multi-stream, event, composite)
  • EF Core project compiles cleanly

🤖 Generated with Claude Code

… to match Marten, bump to 1.4.0

Align Polecat's SingleStreamProjection signature with Marten's two-type-parameter
form, enabling string and strongly-typed ID support for projections. Add Snapshot<T, TId>
overloads. Fix nullable strongly-typed ID handling in DocumentMapping, SetId, and
PolecatProjectionStorage (Identity, LoadAsync, LoadManyAsync). Add StronglyTypedId
package and port Marten's Guid-based and string-based strong typed ID projection tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit 178be80 into main Mar 24, 2026
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