Add source generator discovery for natural key aggregates#172
Merged
jeremydmiller merged 2 commits intomainfrom Mar 27, 2026
Merged
Add source generator discovery for natural key aggregates#172jeremydmiller merged 2 commits intomainfrom
jeremydmiller merged 2 commits intomainfrom
Conversation
New NaturalKeyAggregateAttribute emitted by the source generator when a self-aggregating type has a [NaturalKey] property. This allows Marten to auto-register the snapshot projection and natural key infrastructure at startup without requiring explicit Projections.Snapshot<T>(Inline) calls. - AggregateAnalyzer: detect [NaturalKey] properties on aggregate types - EvolverCodeEmitter: emit [assembly: NaturalKeyAggregate(typeof(T))] - NaturalKeyAggregateAttribute: assembly-level marker for discovery Fixes JasperFx/marten#4199 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- JasperFx 1.21.4 → 1.21.5 - JasperFx.Events 1.24.1 → 1.24.2 (new NaturalKeyAggregateAttribute) - JasperFx.Events.SourceGenerator 1.3.0 → 1.4.0 (natural key discovery) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merged
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NaturalKeyAggregateAttributeemitted by the source generator when a self-aggregating type has a[NaturalKey]propertyAggregateAnalyzerdetects[NaturalKey]properties and setsHasNaturalKeyonCandidateInfoEvolverCodeEmitteremits[assembly: NaturalKeyAggregate(typeof(T))]alongside the existingGeneratedEvolverattributeTest plan
🤖 Generated with Claude Code