Skip to content
Discussion options

You must be logged in to vote

Whether IEntityCache is suitable for this use case?

Yes. IEntityCache handles automatic cache invalidation (via EntityChangedEventData<Tenant>) and auto-loading from the repository on cache miss, which fits your scenario well.

Any recommended patterns for caching tenant-related state in ABP middleware?

Define a TenantStatusCacheItem, register it with AddEntityCache<Tenant, TenantStatusCacheItem, Guid>(), and inject IEntityCache<TenantStatusCacheItem, Guid> in your middleware
to check the status.

Also consider the built-in IsActive property on TenantConfiguration — if "Suspended" is essentially "inactive", setting IsActive = false lets ABP handle it automatically
without custom middleware.

B…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by maliming
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@shinojk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants