| BackgroundJobClientExtensionsChangeState Method |
Changes state of a job with the given jobId to
the specified one.
Namespace: HangfireAssembly: Hangfire.Core (in Hangfire.Core.dll) Version: 1.5.0.0
Syntax public static bool ChangeState(
[NotNullAttribute] this IBackgroundJobClient client,
[NotNullAttribute] string jobId,
[NotNullAttribute] IState state
)
<ExtensionAttribute>
Public Shared Function ChangeState (
<NotNullAttribute> client As IBackgroundJobClient,
<NotNullAttribute> jobId As String,
<NotNullAttribute> state As IState
) As Boolean
Parameters
- client
- Type: HangfireIBackgroundJobClient
An instance of IBackgroundJobClient implementation. - jobId
- Type: SystemString
A job, whose state is being changed. - state
- Type: Hangfire.StatesIState
New state for a job.
Return Value
Type:
BooleanTrue, if state change succeeded, otherwise false.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IBackgroundJobClient. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also