当前位置: 动力学知识库 > 问答 > 编程问答 >

.net - Quartz compiling job scripts after runtime?

问题描述:

I want to use Quartz to act as a script scheduler, you write the VB from a GUI and then select a trigger, the code is then compiled and executed on the trigger, the difficult bit is how do I handle it so that it runs this script with in the application context so it can access my entity framework models, etc. How would I achieve this?

网友答案:

Basically what you need is to put Quartz.Server on top of your application. Add this project to your solution.

If you just need to use your entities in quartz jobs then add your project with entities as reference to Quartz.Server and use entities as you do in your main app.

If you use some IoC-container then you can use extensions like this to inject dependecies to the job. Or you can write your own SchedulerFactory and JobFactory and build your job environment here.

分享给朋友:
您可能感兴趣的文章:
随机阅读: