Repository navigation
GH-5297 IDocumentStoreDiagnostics for EF Core DbContexts - #5302
Merged
jeremydmiller merged 1 commit intoOct 31, 2026
Merged
Conversation
Reads only: entity types, paged/filtered/ordered queries, load by key, and the generated SQL as the plan. Scalar properties only, never Include; conjoined and database-per-tenant go through the context builder, AllTenants is refused there; Wolverine's IncomingMessage/OutgoingMessage are identifiable via WolverineMappedEntities. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 1, 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.
Fixes #5297
Adds
DbContextDocumentStoreDiagnostics<T>(registered next to eachDbContextUsageSource, subjectefcore://{Context}), so a tool can browse aDbContext's entities throughIDocumentStoreDiagnostics.Set<T>().AsNoTracking()+ApplyCriteriaTo; translation failures becomeDocumentCriteriaNotSupportedException. Ordered by primary key when no ordering is given. Load by single-column key; keyless/composite-key types are listed and pageable, load returns null,IdEqualsis refused.Include. Owned and shared-type entities aren't listed.WolverineMappedEntities.IsWolverineEntity(...)identifiesIncomingMessage/OutgoingMessage.DocumentTypeRefhas no flag for it, so this is the helper.IDbContextBuilder<T>(conjoined pins the tenant so the query filter scopes it; database-per-tenant picks the tenant database).AllTenantsis refused on those (honouring it on conjoined meansIgnoreQueryFilters, which would bypass other filters too);AllTenants+TenantIdthrowsArgumentException.OrderByMetadata, correlation/causation/last-modified filters (no such columns).ToQueryString). A provider-native plan was not done:ToQueryStringleaves parameters unbound, so it can't be fed toEXPLAINas is. Left as a follow-up.IncludeSoftDeletedis not interpreted.Tests:
efcore_document_store_diagnostics(SQL Server, 12) andconjoined_document_store_diagnostics(Postgres conjoined, 5) pass locally.🤖 Generated with Claude Code