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

Tenant ID on Child Objects #3929


User avatar
0
jseger created

I'm wondering if Tenant ID is necessary on child objects AND if omitting can improve performance.

Let's say I have an Order which has a child list of Order Items. An Order obviously has a tenant id. But an Order Item cannot exist without an order, so does it need a tenant id? Probably not, but is there any risk omitting it? Is there any advantage omitting it? Any thoughts at all?


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

    Without tenant id, if you call OrderItemRepository.GetAll, then cross-tenant Order Items will appear. If you will never access child objects directly, then omitting tenant id is reasonable but unnecessary.

    Performance-wise, omitting an 'int' column in a database table would have negligible improvement.