So I have this weird problem that if I change a record and do something else with hangfire, the hangfire job uses the old data. I am using autofac but I’m a bit lost on what I need to configure to have this work correctly.
If I run the code out of hangfire then everything works fine. I do have the datacontext as InstancePerLifeTimeScope
and the jobservice that runs the hangfirejobs as .InstancePerRequest(AutofacJobActivator.LifetimeScopeTag)
I noticed this link http://stackoverflow.com/questions/27961210/hangfire-dependency-injection-lifetime-scope but wasn’t sure if this was still relevant as it’s a little older.