如何将石英网计划从服务收集到Crystalquartz
我正在尝试使用.NET 5使用石英网和Crystalquartz。 我将调度程序添加到Services Collection中,并使用addquartz
如何从内部的服务集合中获取调度程序?
services.AddQuartz(q =>{
...
q.SchedulerId = "MyScheduler ID";
...
})
I'm trying to use Quartz NET and CrystalQuartz with .NET 5.
I add the scheduler to services collection with AddQuartz
How could I get the scheduler from the services collection within?
services.AddQuartz(q =>{
...
q.SchedulerId = "MyScheduler ID";
...
})
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
作为第一步,您需要安装
Crystalquartz.aspnetcore
nuget软件包到目标项目。在下一步中,您需要将Crystalquartz中间件挂在ASP.NET核心环境中。应该在管道初始化时调用
usecrystalquartz
扩展方法。面板配置的通用语法看起来像:调度程序是您的Ischeduler(本地或远程)。
您应该已经有一个
iScheduler
对象实例,因此您可以将其指向其指向func
将其传递给配置扩展方法:As a first step, you need to install
CrystalQuartz.AspNetCore
NuGet package to the target project.As a next step, you need to hook CrystalQuartz middleware into your ASP.NET Core environment. It should be done by calling
UseCrystalQuartz
extension method at the moment of pipeline initialization. The generic syntax for panel configuration looks like this:scheduler is your IScheduler (local or remote).
You should already have an
IScheduler
object instance so you can pass aFunc
pointing to it to the configuration extension method: