IBackgroundJobClientCreate Method |
Namespace: Hangfire
[CanBeNullAttribute] string Create( [NotNullAttribute] Job job, [NotNullAttribute] IState state )
Exception | Condition |
---|---|
ArgumentNullException | job is null. |
ArgumentNullException | state is null. |
BackgroundJobClientException | Creation failed due to an exception. |
The interface allows implementations to return value for this method when background job creation has been canceled by an implementation under the normal circumstances (not due to an exception). For example, the CreatingContext class contains the Canceled property that may be used by a client filter to cancel a background job creation.
The interface allows implementations to create a background job in a state other than specified. The given state instance also may be modified. For example, ElectStateContext class contains public setter for the CandidateState property allowing to choose completely different state by state election filters.