Skip to content

zhurongbo111/Quartz.NetCore.DependencyInjection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quartz.NetCore.DependencyInjection

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

CI

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 Net5.0 or later, you can just call:

services.AutoStartQuartzJob()

else you need get QuartzLifeTimeManager instance from container, then call the Start method.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages