I need to resolve some Quartz jobs from Autofac's LifeTimeScope. Currently I have implemented factory class:
public class JobWrapper<T> : IJob where T : IJob
In another class I have method that returns resolved job:
public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
{
Type type = bundle.JobDetail.JobType;
return _lifetimeScope.Resolve<JobWrapper<type>>(); // does not work
}
I need to pass generic to JobWrapper class and currently I don't know how to do that.
You can describe the type yourself
There are some good examples for MakeGenericType here and here.