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

Namespace: Hangfire.States
Assembly: Hangfire.Core (in Hangfire.Core.dll) Version: 1.5.0.0
Syntax
[CanBeNullAttribute]
string Reason { get; }

Property Value

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

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