Skip to content

Promote the ITenanted marker interface into JasperFx.MultiTenancy #531

Description

@jeremydmiller

Part of the Wolverine conjoined EF Core multi-tenancy epic (JasperFx/wolverine#3465).

Marten (Marten.Metadata.ITenanted) and Polecat (Polecat.Metadata.ITenanted) declare identical empty marker interfaces extending JasperFx.MultiTenancy.IHasTenantId:

public interface ITenanted : IHasTenantId {}

Wolverine is about to need the same marker for conjoined EF Core tenancy, where ITenanted on an EF entity opts it into Wolverine-managed conjoined multi-tenancy (mapped tenant_id column, tenant-bound global query filter, stamp-on-insert, cross-tenant write rejection) — mirroring what the marker already means for Marten and Polecat documents.

Proposed work

  • Add ITenanted : IHasTenantId to JasperFx.MultiTenancy, with the settable-TenantId doc contract both libraries already imply ("the framework sets TenantId on write and populates it from storage on load").
  • Marten: re-point Marten.Metadata.ITenanted at the JasperFx interface (type-forward/alias, same pattern used when TenancyStyle moved).
  • Polecat: same for Polecat.Metadata.ITenanted.

This follows the IHasTenantId dedupe from #224 — one marker drives conjoined behavior across Marten, Polecat, and Wolverine so a shared entity/document type works in all three.

Small change, but it should lead the next lockstep release since the Wolverine epic keys off it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions