Skip to content

GH-3465: worked-example documentation for conjoined EF Core multi-tenancy - #3532

Merged
jeremydmiller merged 1 commit into
mainfrom
gh-3465-conjoined-efcore-docs-samples
Jul 20, 2026
Merged

GH-3465: worked-example documentation for conjoined EF Core multi-tenancy#3532
jeremydmiller merged 1 commit into
mainfrom
gh-3465-conjoined-efcore-docs-samples

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Documentation follow-up for the conjoined EF Core multi-tenancy epic (#3465). The feature (Phases 1–3), the ConjoinedMultiTenantedEfCore sample app (#3515), and the reference docs already shipped for 6.21 — but the docs described the application-code payoff ("your handlers never touch TenantId") only in prose, and every code snippet came from the synthetic MultiTenancyDocumentationSamples.cs test file.

What this adds

A new "A Worked Example" section on docs/guide/durability/efcore/multi-tenancy.md that shows the real end-to-end code:

  • an ITenanted entity (plus a deliberately non-tenanted Product)
  • a completely vanilla DbContext
  • HTTP tenant detection configured once
  • a stamp-on-insert write endpoint that never touches TenantId
  • a tenant-scoped read endpoint and a tenant-scoped message handler
  • the CrossTenantWriteException write-side guard

Every snippet is pulled via mdsnippets from the merged ConjoinedMultiTenantedEfCore sample app, which is part of wolverine.slnx, so the samples are live and compile-verified rather than hand-typed. The section also links prominently to the runnable sample and its guided curl tour.

Done in a single PR to avoid the CI tax. Only the target docs page and the sample-app source (region markers) change; the other 50+ pages mdsnippets regenerated from the checkout were reverted.

Follow-up filed

#3531 — test conjoined EF Core tenant partitioning alongside a mix of Marten conjoined tenancy, and alongside Polecat, in one shared database (out of scope here; needs a multi-store rig, and the Polecat leg may gate on JasperFx/polecat#335).

🤖 Generated with Claude Code

…m the sample app

The conjoined EF Core multi-tenancy docs described the application-code payoff
("your handlers never touch TenantId") in prose but only ever showed synthetic
registration snippets from the test project. This adds a "A Worked Example"
section to the EF Core multi-tenancy page that shows the real end-to-end code —
an ITenanted entity, a vanilla DbContext, HTTP tenant detection, a
stamp-on-insert write endpoint, tenant-scoped read endpoint + message handler,
and the CrossTenantWriteException write-side guard — all pulled as live,
compile-verified snippets from the merged ConjoinedMultiTenantedEfCore sample
app (which is in wolverine.slnx), plus a prominent link to the runnable sample.

Follow-up #3531 filed for mixed-engine partitioning coverage (EF Core conjoined
partitioning alongside Marten, and alongside Polecat, in one database).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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