Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Best Place to assign TenantId #8146


User avatar
0
fawad29 created

We have an entity which inherits from IMustHaveTenant. We want to assign tenant id from the session using AbpSession.GetTenantId() when a tenant user creates this entity, can you please confirm the best place to assign tenant id? Should this be done in the Create function of the EntityAppService?


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    can you please confirm the best place to assign tenant id? Should this be done in the Create function of the EntityAppService?

    You should set the TenantId value when you create the entity object. Because the TenantId may change when SaveChange is called.

  • User Avatar
    0
    ismcagdas created
    Support Team

    This issue is closed because it has not had recent activity for a long time.