标签:datetime ESS date ilog 发布 name https 命令 ado
StowayNet.Extensions.Quartz是为了简化Quartz在.net core项目中的调用而写的开源项目,并且对Quartz进行了改进,让其支持依赖注入。
Github地址:https://github.com/stoway/StowayNet.Extensions.Quartz
你可以运行以下命令在你的项目中安装 StowayNet.Extensions.Quartz
.
PM> Install-Package StowayNet.Extensions.Quartz
首先配置 StowayNet.Extensions.Quartz
到 Startup.cs 文件中,如下:
......
using StowayNet;
......
public void ConfigureServices(IServiceCollection services)
{
......
services.AddStowayNet();
......
}
class TestJob : StowayNet.Extensions.Quartz.IQuartzJob
{
private readonly ILogger<TestJob> _logger;
public string ServiceName => nameof(TestJob);
public string QuartzCronExpression => "*/2 * * * * ?";
public TestJob(ILogger<TestJob> logger)
{
_logger = logger;
}
public Task Execute(IJobExecutionContext context)
{
_logger.LogDebug($"{nameof(TestJob)} start, {DateTime.Now:G}");
return Task.CompletedTask;
}
}
标签:datetime ESS date ilog 发布 name https 命令 ado
原文地址:https://www.cnblogs.com/stoway/p/13039466.html