Table of Contents

Class TypeLoaderOptions

Namespace
Quartz
Assembly
Quartz.dll

Strongly typed configuration for the type loader, which turns a type name into a type — a stored JOB_CLASS_NAME, a quartz.* .type key, a job named in XML or JSON scheduling data.

public sealed class TypeLoaderOptions
Inheritance
TypeLoaderOptions
Inherited Members

Remarks

Binds from the TypeLoader section of the Quartz configuration, so a rename can ship in appsettings.json with the deployment that performs it: Quartz:TypeLoader:Aliases:<old name> is the new name.

Type loading is container-wide rather than per-scheduler — one ITypeLoader serves every scheduler in the container, which is what UseTypeLoader<T>() replaces — so these are the container's options whichever scheduler's section they were written in.

Properties

Aliases

What a type name that no longer names anything means today: the name as it was stored or configured, mapped to the name of the type that replaced it.

public Dictionary<string, string?> Aliases { get; }

Property Value

Dictionary<string, string>

Remarks

Keys are compared the way the built-in loader compares its own table of Quartz's 3.x → 4.0 renames: ordinal, and matching either the whole name or the part of it before the comma that starts the assembly. So Acme.Jobs.NightlyReport matches however the assembly is spelled after it, and Acme.Jobs.NightlyReport, Acme.Jobs matches only that assembly.

A value that names its own assembly replaces the whole name; one that does not keeps whatever followed the old name, which is what makes a mapping between two types in the same assembly a single namespace-qualified name.

Nothing is written back. A job read out of the store under an aliased name still has the stored spelling in JOB_CLASS_NAME, so an alias is what keeps a rolling deployment working rather than a migration in disguise; the UPDATE in the troubleshooting page is still how an alias is eventually retired.

Methods

Map(string, Type)

Declares that name — a type name already stored or already written in a configuration file — now means type.

public TypeLoaderOptions Map(string name, Type type)

Parameters

name string

The name as it was stored or configured.

type Type

The type that name resolves to now.

Returns

TypeLoaderOptions

This instance, so several renames can be declared in one chain.

Remarks

The typed half of Aliases, for a rename whose target the application can name in code. The type is recorded by the same assembly-qualified, version-free spelling Quartz stores a job type under, so a mapping written here and one written in configuration are the same entry.