Open Closed

How can the Global Admin Role create records in the context of an individual Tenant #3181


User avatar
0
barrett2474 created
  • ABP Framework version: v5.22
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

The global admin of our site needs to add new records in a table for all our Tenants.. Its kind of a bulk process we have.

Can the global Admin make inserts/updates "in the context" of a Tenant?

Thank you!

John

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

2 Answer(s)
  • User Avatar
    1
    liangshiwei created
    Fullstack Developer

    Hi,

    See: https://docs.abp.io/en/abp/latest/Multi-Tenancy#change-the-current-tenant

    You can change the current tenant.

    For example:

    var tenants = await TenantRepository.GetListAsync();
    
    foreach(var tenant in tenants)
    {
        using(CurrentTenant.Change(tenant.Id))
        {
            //inserts/updates for a tenant here..
        }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    barrett2474 created

    that's great - thanks for the fast response!

    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 21, 2026, 06:18
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.