We're using Hangfire for some nightly and long running jobs, and we're tracking additional related details/metadata for each job within a separate database to avoid Hangfire upgrade issues in the future. A job filter (https://docs.hangfire.io/en/latest/extensibility/using-job-filters.html) would help us track the status of each job in a much easier manner, but I can't find a sample of how to send in dependencies to the job filter.
We're running ASP.NET Core with dependency injection (DI) and the repository + unit of work patterns.
How would I be able to access the database context (or unit-of-work, or any other items available via DI) from within the job filter?
EDIT I've created a repository with a small sample project that outlines what I'm trying to do here: https://github.com/joelpereira/hfjobfilter/tree/master/HFJobFilter
It compiles but has an error on the line: .UseFilter(new TypeFilterAttribute(typeof(LogToDbAttribute)))