private static ITrigger CreateTrigger(JobSchedule schedule)
 {
     return(TriggerBuilder
            .Create()
            .WithIdentity($"{schedule.JobType.FullName}.trigger")
            .WithCronSchedule(schedule.CronExpression)
            .WithDescription(schedule.CronExpression)
            .Build());
 }
        private static IJobDetail CreateJob(JobSchedule schedule)
        {
            var jobType = schedule.JobType;

            return(JobBuilder
                   .Create(jobType)
                   .WithIdentity(jobType.FullName)
                   .WithDescription(jobType.Name)
                   .Build());
        }
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            var jobSchedule = new JobSchedule(jobType: typeof(AlertJob), cronExpression: "0 0/5 * * * ?");

            var job     = CreateJob(jobSchedule);
            var trigger = CreateTrigger(jobSchedule);

            await _scheduler.ScheduleJob(job, trigger, cancellationToken);

            //await _scheduler.Start(cancellationToken);
        }