I try to find a solution to insert a custom history in a Job during the process, but I not found.
Then I want to create a log generator to a job process inserting directly in State table. For to do this, is necessary pass JobId. So, how can I get current JobId?
BackgroundJob.Enqueue(() => this.ProcessReport( Report.Id, Param));
...
public override void ProcessReport(long ReportId, Dictionary<string, object> Params)
{
// Some things....
Hangfire.InsertHistory(JobId, Reason, Data); // <-- Here. There is how get current JobId?
// Some more stuff...
}