Base solution for your next web application
Open Closed

Set TenantId Zero instead of NULL #11056


User avatar
0
SRTMDEV created

Hello Team,

Can we set TenantId value to Zero for host records instead of NULL?


5 Answer(s)
  • User Avatar
    0
    musa.demir created

    It is not how it is designed. To make this change, you have to make changes in many places, including the framework's code. Why do you need that? We may offer another solution to you.

  • User Avatar
    0
    SRTMDEV created

    It is not how it is designed. To make this change, you have to make changes in many places, including the framework's code. Why do you need that? We may offer another solution to you.

    Hello Team, Currently we have a requirement where we need to setup master data in Host tenant and copy in each of tenant. Now if copy master-detail data, then we have to do operation for each table to maintain master identity in child table. To eliminate this we introduced GId in which there is no any required to change data while copy to tenant. Now here we want to maintain Primary/Foreign Key in respected table with combination of Tenant Id and GId but due to Tenant Id is allow to NULL we are unable to set. With limitation, we need to write EF join query to read data from child table.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @SRTMDEV

    I couldn't understand the problem very well but you may use IMustHaveTenant instead of IMayHaveTenant which doesn't allow NULL values.

  • User Avatar
    0
    SRTMDEV created

    Hi @SRTMDEV

    I couldn't understand the problem very well but you may use IMustHaveTenant instead of IMayHaveTenant which doesn't allow NULL values.

    Hello ismcagdas, My requirement is I want to create some master/template data in Host side and want to copy this data when creating new tenant. Now I am use same database and table for Host and Tenant so in this case IMustHaveTenant can not be use.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    So, If I understand correctly, you are showing data with TenantId=0 to all tenants and host, is that correct ? In that case, what problem oyu are facing when you try to show data with TenantId=NULL to host and all other tenants ?