public static IServiceCollection AddJob <T>(this IServiceCollection services, Action <HostedJobOptionsBuilder <T> > configureJobOptions) where T : class, IJob
        {
            var jobOptionsBuilder = new HostedJobOptionsBuilder <T>();

            configureJobOptions?.Invoke(jobOptionsBuilder);
            return(services.AddJob <T>(jobOptionsBuilder.Target));
        }
Пример #2
0
        public static IServiceCollection AddJob(this IServiceCollection services, Action <HostedJobOptionsBuilder> configureJobOptions)
        {
            var jobOptionsBuilder = new HostedJobOptionsBuilder();

            configureJobOptions?.Invoke(jobOptionsBuilder);
            return(services.AddJob(jobOptionsBuilder.Target));
        }