When i am passing PerformingContext as parameter in method it is always null. I am using version 1.6.17
Method signature :
[AutomaticRetry(Attempts = 0)]
public void UserChatHistory(int userId, int chatId, int maxId, Guid jobId, PerformingContext hangfireContext)
Init:
BackgroundJob.Enqueue<GetMessages>(gm => gm.ChatHistory(command.CurrentUserId, command.ChatId, int.MaxValue, jobId, null));
Configuration :
GlobalConfiguration.Configuration.UseActivator(new ContainerJobActivator(HangfireIocConfig.RegisterDependencies()));
GlobalConfiguration.Configuration.UseSqlServerStorage(ConfigKeys.HangfireConnectionString);
app.UseHangfireDashboard();
app.UseHangfireServer();
Unfortunately PerformingContext cannot be resolved by autofac when instance of GetMessages
is created.
At first I thought this is because i am using Autofac but i have commented this line
GlobalConfiguration.Configuration.UseActivator(new ContainerJobActivator(HangfireIocConfig.RegisterDependencies()));
and nothing changed