Click or drag to resize
DeletedStateReason Property
Gets the human-readable reason of a state transition.

Namespace: Hangfire.States
Assembly: Hangfire.Core (in Hangfire.Core.dll) Version:
public string Reason { get; set; }

Property Value

Type: String
Any string with a reasonable length to fit dashboard elements.



The reason is usually displayed in the Dashboard UI to simplify the understanding of a background job lifecycle by providing a human-readable text that explains why a background job is moved to the corresponding state. Here are some examples:

  • Can not change the state to 'Enqueued': target method was not found
  • Exceeded the maximum number of retry attempts
Note Notes to Implementers
The reason value is usually not hard-coded in a state implementation, allowing users to change it when creating an instance of a state through the public setter.
See Also