Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 974 Bytes

GiG.Core.MultiTenant.Activity.md

File metadata and controls

23 lines (14 loc) · 974 Bytes

GiG.Core.MultiTenant.Activity

This Library provides an API to register Multi Tenancy for an application through key-value pair items in the Activity Baggage.

Please refer to this link for more information on the .netcore implementation of Activity and Baggage.

Basic Usage

The below code needs to be added to the Startup.cs. This will register the Activity Tenant Accessor.

public void ConfigureServices(IServiceCollection services)
{
    services.AddActivityTenantAccessor();
}

The accessor provides a readonly access to the TenantID items in the activity baggage through the 'Values' property.

Tenant ID Middleware

In web applications where the request headers may contain the TenantID, making use of the middleware documented here allows transfer of TenantId values from the http context into the activity baggage.