Finbuckle.MultiTenant: Problem with link generation
Steps to reproduce:
- Clone Finbuckle.MultiTenant
- Edit IdentityDataIsolationSample/Shared/_Layout
- Add a navbar link:
<a asp-page="/HelloWorld" class="nav-item nav-link">Sample</a> - Add an empty razor page: IdentityDataIsolationSample/Pages/Index.cshtml
Outside of a tenant, things work fine:

However, select a tenant, and notice this:

The URL becomes: https://localhost:5001/HelloWorld?__tenant__=initech
I notice to fix it, I can add: asp-route-__tenant__=""
Is this expected?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (8 by maintainers)
First of all thanks for the donation – it really helps!
Yeah I’ve thought about this a little bit too and there are always trade offs like you mentioned before. One thing to try is to mess with the <a> tag helper to try to make it tenant aware and tell if if you want a tenant link or not. Or just stick to the route strategy.
I’ll admit that I mostly use the host strategy which sidesteps the link issue but is difficult to develop for.
I also think there is a lot of potential in the session strategy but you have to have some way to determine the initial tenant to set the session variable – maybe a user claim or something. So many option and ultimately all of them have edge cases because at its core I’m just manipulating what I can in .NET without any official support.