Table of Contents

Class JobFactoryOptions

Namespace
Quartz
Assembly
Quartz.dll

Settings for the job factory that builds jobs from the container.

public sealed class JobFactoryOptions
Inheritance
JobFactoryOptions
Inherited Members

Remarks

Per-scheduler, like every other component's options: under AddQuartz("reporting", …) these are reporting's, and the default scheduler's are its own.

Properties

ConfigureScope

Prepares the dependency injection scope a job is about to be built in.

public Action<IServiceScope, TriggerFiredBundle, IScheduler>? ConfigureScope { get; set; }

Property Value

Action<IServiceScope, TriggerFiredBundle, IScheduler>

Remarks

This is the hook for services that are scoped and need the ambient context of a job — a tenant read from the trigger's data, a correlation id, an AsyncLocal<T> the job's dependencies read. It runs before the job is resolved, so anything it sets is in place while the job and everything it injects are constructed.

It is deliberately synchronous. An asynchronous hook would be awaited, and an ExecutionContext restored on the way back would discard exactly the AsyncLocal<T> values this exists to set.

Setting it combines rather than replaces, so two callbacks each get their say; they run in the order they were added. It was previously reachable only by deriving from MicrosoftDependencyInjectionJobFactory and overriding a protected method — which meant writing and registering a job factory to set one AsyncLocal<T>.