Exemple #1
0
        public static JobSchedulerBuilder AddJob <TJob>(this JobSchedulerBuilder builder) where TJob : class, IJob
        {
            var jobType = typeof(TJob);

            var cronExpression = _jobSettings.Jobs.Where(e => e.JobType.Equals(jobType.Name))
                                 .Select(e => e.CronExpression)
                                 .First();

            builder.Services.AddScoped(jobType);
            builder.Services.AddSingleton(new JobSchedule(jobType: jobType, cronExpression: cronExpression));

            return(builder);
        }
Exemple #2
0
 public static void Configure(this JobSchedulerBuilder builder)
 {
 }