Skip to content

The project is the extensions of Quartz for .net core project, it benefits you from DependencyInjection.

License

Notifications You must be signed in to change notification settings

zhurongbo111/Quartz.NetCore.DependencyInjection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quartz.NetCore.DependencyInjection

The project is the extensions of Quartz for .net core project, it benefits you from DependencyInjection.

nuget publish

Packages

NuGet feed: https://www.nuget.org/packages/Quartz.NetCore.DependencyInjection/

Package NuGet Stable NuGet Pre-release Downloads
Quartz.NetCore.DependencyInjection Quartz.NetCore.DependencyInjection Quartz.NetCore.DependencyInjection Quartz.NetCore.DependencyInjection

Features

Quartz.NetCore.DependencyInjection is a NuGet library that you can add into your project that will benefit you from DependencyInjection for Quartz Job.

Examples

please see the example:samples

Usage

First of all, add this namespace:

using Quartz.NetCore.DependencyInjection;

In ConfigureServices, you need register jobs to container:

    services.ConfigQuartzJob<DemoJob>(
                jobBuilder => jobBuilder.WithIdentity("DemoJobKey").Build(),
                //Run job every 10 seconds
                triggerBuild => triggerBuild.WithIdentity("DemoJobTriggerKey")
                                            .StartAt(DateTime.Now.AddSeconds(10))
                                            .WithSimpleSchedule(
                                                    ssb => ssb.WithInterval(TimeSpan.FromSeconds(10))
                                                    .RepeatForever())
                                            .Build());

If you are in asp.net core 3.1 or later, you can just call:

services.AutoStartQuartzJob()

else you need get QuartzLifeTimeManager instance from container, then call then Start method. Note: You should get instance at root service provider

About

The project is the extensions of Quartz for .net core project, it benefits you from DependencyInjection.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages