I'm just learning Quartz.NET (and C# in general in fact) and I'm struggling to get my head around the differences between the AddQuartz and AddQuartzHostedService methods. From what I've seen here, here and here, it seems that AddQuartz adds and configures the Quartz scheduler, and AddQuartzHostedService explicitly adds this Quartz service (which I assume is the configured scheduler) as a hosted service... Have I got this right?
And in what context would I ever use AddQuartz if I don't intend to add it as a hosted service? Please help me clear up any misconceptions I might have. Thanks.
AddQuartzconfigures the scheduling system by adding jobs and when they need to be called.AddQuartzHostedServiceon the other hand sets up the scheduling system to run in the background as a hosted service, letting it run its jobs and (optionally) wait for any scheduled jobs before allowing the application to exit.You always use both of them together.