コード例 #1
0
        private static IJobDetail CreateJob(JobSettings schedule, List <Type> types)
        {
            var jobType = types.FirstOrDefault(x => x.FullName == schedule.FullName);

            if (jobType == null)
            {
                return(null);
            }

            return(JobBuilder
                   .Create(jobType)
                   .WithIdentity(schedule.JobKey)
                   .WithDescription(jobType.Name)
                   .Build());
        }
コード例 #2
0
        private static ITrigger CreateTrigger(JobSettings schedule, List <Type> types)
        {
            var jobType = types.FirstOrDefault(x => x.FullName == schedule.FullName);

            if (jobType == null)
            {
                return(null);
            }

            return(TriggerBuilder
                   .Create()
                   .WithIdentity($"{jobType.FullName}.trigger")
                   .WithCronSchedule(schedule.Cron)
                   .WithDescription(schedule.Cron)
                   .Build());
        }