EasyCore.Quartz.SqlServer 8.0.0

dotnet add package EasyCore.Quartz.SqlServer --version 8.0.0
                    
NuGet\Install-Package EasyCore.Quartz.SqlServer -Version 8.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EasyCore.Quartz.SqlServer" Version="8.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasyCore.Quartz.SqlServer" Version="8.0.0" />
                    
Directory.Packages.props
<PackageReference Include="EasyCore.Quartz.SqlServer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EasyCore.Quartz.SqlServer --version 8.0.0
                    
#r "nuget: EasyCore.Quartz.SqlServer, 8.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EasyCore.Quartz.SqlServer@8.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EasyCore.Quartz.SqlServer&version=8.0.0
                    
Install as a Cake Addin
#tool nuget:?package=EasyCore.Quartz.SqlServer&version=8.0.0
                    
Install as a Cake Tool

EasyCore.Quartz Project Documentation

Introduction

EasyCore.Quartz is a task scheduling framework encapsulation based on Quartz, designed to simplify the use of scheduled tasks in .NET projects. It supports triggering tasks via HTTP requests and provides database configuration support for MySQL and SQL Server.

This project is suitable for developers who want to quickly integrate scheduled task scheduling functionality and supports managing task creation, pausing, resuming, and deletion through simple APIs.

Features

  • Supports executing scheduled tasks via HTTP requests
  • Provides dynamic task management: add, update, pause, resume, and delete
  • Supports multiple database types (MySQL, SQL Server) for task storage
  • Supports Cron expression configuration for scheduled tasks
  • Simple and easy-to-use API controller for task management
  • Supports task concurrency control and error handling

Installation and Configuration

1. Project Structure

  • src/EasyCore.Quartz: Core library code containing Quartz encapsulation logic
  • src/EasyCore.Quartz.MySql and src/EasyCore.Quartz.SqlServer: Database support for MySQL and SQL Server respectively
  • demo/WebApp.Quartz: Example web application demonstrating how to use EasyCore.Quartz

2. Configure Database Support

In QuartzOptions, you can set the database using the following methods:

options.SetSqlServer("your_sqlserver_connection_string");
options.SetMySql("your_mysql_connection_string");

3. Configure Cron Expressions

Use the EasyCoreCronAttribute to set Cron expressions for tasks, for example:

[EasyCoreCron("0/1 * * * * ?")]
public class QuartzTask : IEasyCoreJob

Usage Examples

Create a Scheduled Task

[EasyCoreCron("0/1 * * * * ?")]
public class QuartzTask : IEasyCoreJob
{
    private readonly ILogger<QuartzTask> _logger;

    public QuartzTask(ILogger<QuartzTask> logger) => _logger = logger;

    public async Task Execute(IJobExecutionContext context)
    {
        _logger.LogInformation("Scheduled task is executing");
    }
}

Manage Tasks Using the API

QuartzController provides RESTful APIs to perform the following operations:

  • Get a list of all tasks
  • Pause and resume tasks
  • Update a task's Cron expression
  • Manually trigger a task
  • Add or update an HTTP task

Example: Add an HTTP task

POST /quartz/addorupdate/httpjob
{
    "JobName": "HttpJob",
    "Url": "http://example.com/api/endpoint",
    "Method": "POST",
    "Cron": "0/1 * * * * ?"
}

Disable a Task

Use the EasyCoreDisableJobAttribute to disable a specific task:

[EasyCoreDisableJob]
public class DisableJobTask : IEasyCoreJob

API Documentation

Get All Tasks

GET /quartz/get/all/jobs

Pause a Task

PUT /quartz/pause/job?jobName=JobName

Resume a Task

PUT /quartz/resume/job?jobName=JobName

Update Task Cron

PUT /quartz/update/cron?jobName=JobName&newCron=0/10 * * * * ?

Delete a Task

DELETE /quartz/delete/job?jobName=JobName

Manually Trigger a Task

POST /quartz/manualtrigger/job?jobName=JobName

Add/Update an HTTP Task

POST /quartz/addorupdate/httpjob
{
    "JobName": "MyHttpJob",
    "Url": "http://your-endpoint.com",
    "Method": "GET",
    "Cron": "0/5 * * * * ?"
}

Contribution Guidelines

We welcome the submission of Issues and Pull Requests. Please ensure that your code style matches the existing code and provide complete unit tests.

License

This project uses the MIT License. For details, please refer to the LICENSE file.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.0 210 11/9/2025
1.0.1 4,201 7/10/2025
1.0.0 301 7/7/2025