コード例 #1
0
 private static IJobDetail CreateJob(JobMetadata jobMetadata)
 {
     return(JobBuilder
            .Create(jobMetadata.JobType)
            .WithDescription(jobMetadata.JobType.Name)
            .Build());
 }
コード例 #2
0
 private static ITrigger CreateTrigger(JobMetadata jobMetadata)
 {
     return(TriggerBuilder
            .Create()
            .WithCronSchedule(jobMetadata.CronExpression)
            .WithDescription(jobMetadata.JobType.Name)
            .Build());
 }
コード例 #3
0
 public TimerHostedService(
     ISchedulerFactory schedulerFactory,
     IJobFactory jobFactory,
     JobMetadata jobMetadata)
 {
     _schedulerFactory = schedulerFactory;
     _jobFactory       = jobFactory;
     _jobMetadata      = jobMetadata;
 }