Fix ConfigureMarten not being called for projection view types#4157
Merged
jeremydmiller merged 1 commit intomasterfrom Mar 3, 2026
Merged
Fix ConfigureMarten not being called for projection view types#4157jeremydmiller merged 1 commit intomasterfrom
jeremydmiller merged 1 commit intomasterfrom
Conversation
When a document type was registered only through a projection (e.g., MultiStreamProjection), StorageFeatures.Build() used the non-generic DocumentMapping constructor which skips the ConfigureMarten reflection lookup. Now uses DocumentMappingBuilder<T> to ensure the generic DocumentMapping<T> constructor is always used, which discovers and invokes the static ConfigureMarten method. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 9, 2026
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
ConfigureMartenmethod on a view type was never invoked when the type was registered only through a projection (e.g.,MultiStreamProjection<TDoc, TId>)StorageFeatures.Build()used the non-genericDocumentMapping(Type, StoreOptions)constructor as a fallback, which skips theConfigureMartenreflection lookup that only exists in the genericDocumentMapping<T>constructorDocumentMappingBuilder<T>(viaCloseAndBuildAs) in the fallback path, which creates aDocumentMapping<T>that properly discovers and invokesConfigureMartenTest plan
uses_ConfigureMarten_for_projection_view_type_registered_only_via_projectionthat verifiesConfigureMartenis called for aMultiStreamProjectionview type🤖 Generated with Claude Code