| BackgroundJobClientExtensionsScheduleT Method (IBackgroundJobClient, ExpressionActionT, DateTimeOffset) |
Creates a new background job based on a specified method expression and schedules
it to be enqueued at the specified moment.
Namespace: HangfireAssembly: Hangfire.Core (in Hangfire.Core.dll) Version: 1.5.0.0
Syntax public static string Schedule<T>(
[NotNullAttribute] this IBackgroundJobClient client,
[NotNullAttribute][InstantHandleAttribute] Expression<Action<T>> methodCall,
DateTimeOffset enqueueAt
)
<ExtensionAttribute>
Public Shared Function Schedule(Of T) (
<NotNullAttribute> client As IBackgroundJobClient,
<NotNullAttribute><InstantHandleAttribute> methodCall As Expression(Of Action(Of T)),
enqueueAt As DateTimeOffset
) As String
Parameters
- client
- Type: HangfireIBackgroundJobClient
A job client instance. - methodCall
- Type: System.Linq.ExpressionsExpressionActionT
Method call expression that will be marshalled to the Server. - enqueueAt
- Type: SystemDateTimeOffset
Moment at which the job will be enqueued.
Type Parameters
- T
- Type whose method will be invoked during job processing.
Return Value
Type:
StringUnique identifier of a created job.
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