Open
Conversation
…endpoints (#10) Implement hero favorites and hero types grains with tenant context support, enhance tenant context configuration, and update related documentation. Refactor grain activation strategies and improve performance with ValueTask. Update API endpoints for hero types and modify grain key formats to include tenant prefixes. Clean up and streamline code for better maintainability. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
## Summary
Adds a non-generic `ITenantAccessor` base interface so callers that only
need `.Tenant.Key` (or just the tenant as `ITenant`) don't have to
depend on the full typed generic.
## Changes
### Core (`Sketch7.Multitenancy`)
- **`ITenantAccessor.cs`** — Added non-generic `ITenantAccessor` with
`ITenant? Tenant { get; }`. `ITenantAccessor<TTenant>` now extends it
and hides `Tenant` with the typed `TTenant?` property.
`TenantAccessor<TTenant>` adds an explicit `ITenantAccessor.Tenant =>
Tenant` implementation.
- **`MultitenancyServiceCollectionExtensions.cs`** — Registers
`ITenantAccessor` (non-generic) as Scoped, pointing to the same
`TenantAccessor<TTenant>` instance.
- **`MultitenancyBuilder.cs`** — Proxy factory now resolves
`ITenantAccessor` (non-generic) instead of `ITenantAccessor<TTenant>`;
it only needs `.Tenant?.Key`.
### Sample API
- **`HeroesEndpoints.cs`** / **`HeroTypeEndpoints.cs`** — Dropped
`ITenantAccessor<AppTenant>` → `ITenantAccessor` since both only access
`.Tenant!.Key`. Removed unused `Tenancy` using directive.
### Tests
- **`MultitenancyMiddlewareTests.cs`** — Changed assertion to resolve
`ITenantAccessor` (non-generic) since only `.Key` is checked.
## Breaking changes
`ITenantAccessor<TTenant>` now has `new TTenant? Tenant { get; }` which
hides the base interface member. Callers casting to
`ITenantAccessor<TTenant>` are unaffected; callers using
`ITenantAccessor` get back `ITenant?`.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephenlautier <3908723+stephenlautier@users.noreply.github.com>
Co-authored-by: Stephen Lautier <stephen.lautier@outlook.com>
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.
Automated release PR for
v1.0.0.Merge this PR to publish the stable release and create the GitHub Release.