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 v8.2.0-preview Updated on March 25, 2024, 15:11