Starts in:
2 DAYS
5 HRS
3 MIN
38 SEC
Starts in:
2 D
5 H
3 M
38 S
Open Closed

Source code of tenantId setter for IMultiTenant entities #5887


User avatar
0
mgurer created

Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v7.3.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:" Hello, when an multitenant entity is saved, tenantId property is automatically set to currentusers' tenantId value. If I manually set the tenantId property of the entity to a predefined one, framework does not change the value. I would like see the source code of that behavior. I downloaded the source code, and try to find code of that mechanism, but could not figure out the relates codes. Can you please tell me where to look at? I want to see related codes. Thanks.

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

    hi

    ObjectHelper.TrySetProperty(
        multiTenantEntity,
        x => x.TenantId,
        () => your_tenantId
    );
    
  • User Avatar
    0
    mgurer created

    Thanks

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06