Open Closed

Assign user to tenants #7038


User avatar
0
i.ullah@fandaqah.com created

Need to assign user to the tenant but didn't find option to assign user to any tenant. kindly guide.

  • ABP Framework version: v8.0.5
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

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

    hi

    The tenant(TenantId) is set when a user is created.

    https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUser.cs#L165

    1. There may be some related user data, so you can delete a user and re-create a new user with a specific tenant
    2. You can change the TenantId of a user by ObjectHelper
    var user = await UserManager.GetByIdAsync
    ObjectHelper.TrySetProperty(user, x => x.TenantId, () => NewTenantId);
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 09, 2026, 11:56
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.