diff --git a/docs/en/UI/Blazor/CurrentTenant.md b/docs/en/UI/Blazor/CurrentTenant.md index 8de10e4951..0ccee9966c 100644 --- a/docs/en/UI/Blazor/CurrentTenant.md +++ b/docs/en/UI/Blazor/CurrentTenant.md @@ -1,3 +1,23 @@ # Blazor UI: Current Tenant -TODO \ No newline at end of file +`ICurrentTenant` service can be used to get information about the current tenant in a [multi-tenant](../../Multi-Tenancy.md) 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** + +````csharp +@page "/" +@using Volo.Abp.MultiTenancy +@inject ICurrentTenant CurrentTenant +@if (CurrentTenant.IsAvailable) +{ +
Current tenant name: @CurrentTenant.Name
+} +```` + +## See Also + +* [Multi-Tenancy](../../Multi-Tenancy.md) \ No newline at end of file