Docs
Tenantry ProAPI reference

QuartzProBuilderExtensions class

Namespace: Tenantry.Pro.Quartz.Extensions · Package: Tenantry.Pro.Quartz · API reference

Extension methods for registering Quartz tenant-propagation services on ProBuilder<TKey>.

public static class QuartzProBuilderExtensions

Methods

AddQuartzTenantScope<TKey>(ProBuilder<TKey>, Action<TenantPropagationOptions>?)

Decorates the Quartz IJobFactory so every scheduled job runs inside the tenant scope identified by the tenant ID stamped into its job data map (via JobDataMapExtensions.WithTenant<TKey>). Jobs whose data map has no (or an unparseable / unknown) tenant run without a scope.

public static ProBuilder<TKey> AddQuartzTenantScope<TKey>(this ProBuilder<TKey> builder, Action<TenantPropagationOptions>? configure = null) where TKey : IEquatable<TKey>, IParsable<TKey>

Type parameters:

  • TKey: The tenant identifier type.

Parameters:

  • builder ProBuilder<TKey>: The Pro builder.
  • configure Action<TenantPropagationOptions>: Optional configuration of the tenant-propagation policy — in particular TenantPropagationOptions.OnMissingTenant, which controls what happens to a scheduled job that has no resolvable tenant. Defaults to Warn.

Returns: ProBuilder<TKey>: The same builder for chaining.

Call this AFTER services.AddQuartz(...) so the Quartz-registered IJobFactory exists and can be decorated. Stamp tenants at schedule time, e.g. new JobDataMap().WithTenant(tenantId) passed to JobBuilder.UsingJobData(...).

On this page