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()); }
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()); }