Blazor UI: Current Tenant

ICurrentTenant service can be used to get information about the current tenant in a multi-tenant application. ICurrentTenant defines the following properties;

  • Id (Guid): Id of the current tenant. Can be null if the current user is a host user or the tenant could not be determined.
  • Name (string): Name of the current tenant. Can be null if the current user is a host user or the tenant could not be determined.
  • IsAvailable (bool): Returns true if the Id is not null.

Example: Show the current tenant name on a page

@page "/"
@using Volo.Abp.MultiTenancy
@inject ICurrentTenant CurrentTenant
@if (CurrentTenant.IsAvailable)
{
    <p>Current tenant name: @CurrentTenant.Name</p>
}
C#

See Also

Contributors


Last updated: July 31, 2024 Edit this page on GitHub

Was this page helpful?

Please make a selection.

To help us improve, please share your reason for the negative feedback in the field below.

Please enter a note.

Thank you for your valuable feedback!

Please note that although we cannot respond to feedback, our team will use your comments to improve the experience.

Community Talks

Deep Dive #1: Identity&Account Modules

17 Apr, 17:00
Online
Watch the Event
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book