Base solution for your next web application
Open Closed

Understanding of null TenantId #9955


User avatar
0
murphymj5209 created

I am on the current release of AspnetZero, 10.1-rc1 and am doing programming for the new system. My questions are very general and I want a better understanding of AspnetZero 'null' TenantId field and its impact on the design and programming within Aspnet Zero. I have read the normal published doc in the a) https://aspnetboilerplate.com/Pages/Documents and b) https://docs.aspnetzero.com/en/common/latest

Here is my current understanding; 'somehow' I add a null Tenant to a AspnetZero PowerTools table. For Null TenantIds I can do a SQL Insert statenment or Seed data within the coding. If I add a table with PowerTools, go to that area and add a row, it add the row with a non-null TenantId.

If there is another way to add a Null TenantId, please let me know.

Last question / statement, if I add a Null TenantId, (in general), then this can be used for all Tenants within my application. Again, please corrent my understanding.


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

    Hi @murphymj5209

    Last question / statement, if I add a Null TenantId, (in general), then this can be used for all Tenants within my application. Again, please corrent my understanding.

    If the TenantId of an entity is nullable (entity inherits from IMayHaveTenant), then this entity can belong to any tenant (when TenantId is not equal to NULL) or host (when TenantId is NULL).

    For your first question, you need to select both Tenant and Host when creating an entity using Power Tools. In that way, you can create this entity for any Tenant or Host.