Base solution for your next web application
Open Closed

Multitenancy resolution #5


User avatar
0
keirk created

Could someone point me in the right direction - I'm trying to understand how multi tenancy is resolved in module zero, and how I could implement custom resolution (using something other than subdomain).

Thanks


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    If you are using multi-tenancy, first you should enable it. Then you can use UserManager's LoginAsync method to login. After login, you can use IAbpSession.TenantId to get current tenant's id. If you are not in host mode (when you don't provide tenancy name, you will be logged in as host) then TenantId will be null.

    To resolve tenancy name, you can use any method including subdomain. Even a simple login form with tenancy name, user name and password. See <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero/blob/master/sample/ModuleZeroSampleProject.Web/Controllers/AccountController.cs">https://github.com/aspnetboilerplate/mo ... troller.cs</a> for a sample of login operation.

    I'm actively working on mutli-tenancy implementation. So, thing may change. I will document in detail when it will be stable.