Reputation: 11
I'm implementing a base class for Recurring jobs in Hangfire using the RecurringJobsExtensions as follows:
public abstract class JobBase<T> : IRecurringJob
{
public void Execute(PerformContext context)
{
//Do some boiler plate stuff
this.Process(context); // Calls job specific features in derived class
//Do some other boiler plate stuff
}
}
public class MyJob : JobBase<MyItem>
{
public void Process(PerformContext context)
{
//Do some specific stuff
}
}
When I load this using the json file, it defines the job method as JobBase.Execute and when trying to run the job tries to instantiate the abstract class which of course won't work. How do I get this to register the type as my derived class?
Upvotes: 1
Views: 598
Reputation: 170
There is an issue registered by me a long time ago: https://github.com/icsharp/Hangfire.RecurringJobExtensions/issues/4
As you can see there was no reaction, moreover the last commit into the Hangfire.RecurringJobExtensions repository was around year ago.
So you have 2 options:
Upvotes: 1