ApplicationBuilderHangfireExtensions class
Namespace: Tenantry.Pro.Hangfire.Extensions · Package: Tenantry.Pro.Hangfire · API reference
Extension methods for wiring Tenantry.Pro's Hangfire integration into the ASP.NET Core application pipeline.
public static class ApplicationBuilderHangfireExtensionsMethods
UseTenantryHangfire(IApplicationBuilder)
Adds TenantJobFilter<TKey> to Hangfire's GlobalJobFilters, enabling tenant-context propagation for all enqueued jobs.
public static IApplicationBuilder UseTenantryHangfire(this IApplicationBuilder app)Parameters:
appIApplicationBuilder: The application, whose services hold Hangfire's configuration.
Returns: IApplicationBuilder
This non-generic overload resolves TKey from DI automatically. Requires pro.AddHangfireTenantFilter<TKey>() to have been called during service registration.
var app = builder.Build();
app.UseTenantryHangfire(); // TKey resolved from DI
app.UseHangfireDashboard();
app.Run();UseTenantryHangfire<TKey>(IApplicationBuilder)
Adds TenantJobFilter<TKey> to Hangfire's GlobalJobFilters, enabling tenant-context propagation for all enqueued jobs.
public static IApplicationBuilder UseTenantryHangfire<TKey>(this IApplicationBuilder app) where TKey : IEquatable<TKey>, IParsable<TKey>Type parameters:
TKey: The tenant identifier type.
Parameters:
appIApplicationBuilder: The application builder.
Returns: IApplicationBuilder: The same app for chaining.
Call this after app.Build() and before app.Run(). Requires pro.AddHangfireTenantFilter() to have been called during service registration.
var app = builder.Build();
app.UseTenantryHangfire<string>();
app.UseHangfireDashboard();
app.Run();LicenseRequiredException class
Thrown when no Tenantry.Pro licence key is configured, or the configured key is invalid malformed, a bad signature or the wrong issuer: when the application starts, and by licence-guarded operations.
HangfireProBuilderExtensions class
Extension methods for registering Hangfire tenant-propagation services on ProBuilder<TKey>tenantry-pro-internal-probuilder.md.