Tenant used as key problem
See original GitHub issueThe TTenant
is being used as the key to the concurrent dictionary here: https://github.com/saaskit/saaskit/blob/master/src/SaasKit.Multitenancy/Internal/TenantPipelineMiddleware.cs#L15
However, when the TenantContext
is disposed (memory cache invalidation) the TTenant
instance is disposed. However it’s still left as the key in the concurrent dictionary… Unclear if that will cause problems, but I am raising it as it seems undesirable?
Also there aren’t any constraints that I can see, that make it obvious to implementers of TTenant that they need to support being used a dictionary key. (implement GetHashCode, Equals etc))
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
My tenant is against me having the keys to her house. ...
My tenants have never had issues with me having the keys but there had been at least once where the tenants changed the...
Read more >How to handle tenants' lost keys and related security issues
First, be sure to collect a deposit from each tenant when he/she signs the lease in an amount that would cover the cost...
Read more >10 Things Landlords Need to Know About Keys
7. Prohibit tenants from duplicating keys to reduce the risk. Using keys marked “Do Not Duplicate” will prevent reputable locksmiths or key ...
Read more >4 Things Landlords Are Not Allowed to Do
Although a landlord may own a rental property, tenants have unique protections from discrimination, harassment, arbitrary rent increases, and wrongful eviction.
Read more >Can My Landlord Charge for Spare Keys?
Is it legal to charge tenants for the use of keys that they provided to the landlord? A: Landlords keep tenants' keys for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
…but now I’m seeing #68 and wondering if what I’m doing is such a good idea in light of the auto-disposal of properties. Could be a huge gotcha later. Hmmm. May need to fork.
I ended up using a
string
as myTTenant
and put all the actual tenant config/settings into properties onTenantContext
.