-
-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to access to Tenant by Code #62
Comments
Hi @Sheko007 I'm not sure I understand the question. Are you asking how to access the using Finbuckle.MultiTenant.AspNetCore; // this will be just Finbuckle.MultiTenant in v2.0 coming soon
...
IActionResult MyController()
{
var tenantContext = HttpContext.GetTenantContext();
return View();
} You can also inject the |
Hi @achandlerwhite search and find tenant by name or id return TenantContext and access on it direct |
@Sheko007 However, if you for some reason can't do that, you can get the multitenant store from dependency injection and call |
I don't know if this is still an issue, I had the same issue. I solved it using a custom
and a custom
Configured in startup as:
|
@AndreSteenbergen interesting solution. Testing anything based on subdomains is fundamentally difficult in local development. I found it easier in macOS and Linux (just editing the hosts file) than in Windows (because IIS Express requires more configuration to get it to work). I just found a site that might help. Haven't tested it myself, but I will be: http://readme.localtest.me/ |
there is an etc hosts file in windows as well, it's in the c:\windows\system32\drivers\etc\hosts this is twe way I am testing all subdomains locally. |
how to access to Tenant by Code
The text was updated successfully, but these errors were encountered: