As software as a service has been more ubiquitous, multi-tenancy has become a basic requirement of most web applications. This series will outline ...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks Andrew, this has really helped. Im trying to implement this in .net core 3.1.2
I get an error that says Const does not exist in the current context. What am I missing?
_httpContextAccessor.HttpContext.Items.TryGetValue(Const.CURRENT_TENANT, out object currentTenant);
Hi Gareth, Const is a class I used to keep my constants. Just replace
Const.CURRENT_TENANT
with "Current_Tenant" or any other string you which to use as a key in theHttpContext.Items
dictionary. Updating this to .NET Core 3 is on my list of things to do.Have you done the next post yet?
"In the next post we will modify our Login method to ensure the current user has access to the current domain by using Claims."
I have not, however, I'll be updating it to Core 3.1 soon and writing the next part.
Short and sweet indeed. Thanks for sharing. I find the mention of the hosts file interesting, I've always stayed away from it but I guess I'm ready to give it a shot now :D
I like using the hosts file for development. Especially when building new WordPress sites. I can point a domain at the new site even before DNS propagates and get started on development right away.
Looking forward to the next part of the article.
Thanks for this starter!
Hey Andrew, really helpful post!
Any suggestion about how to get the tenant if I use something like
domain.com/tenant1
domain.com/tenant2
Buenas, cuando saldra
Hello, when will the second part come out, and when will I migrate to use 3.1
Updated the original to include the DI part mentioned at the end. It was simple enough it didn't warrant a post of its own.
Great article! Looking forward to your next article!