Ejemplo n.º 1
0
 public SuperSampleTask(
     IScheduledTaskOptions <SuperSampleTask> options,
     ILogger <SuperSampleTask> logger
     )
 {
     this.Options = options;
     this.logger  = logger;
 }
Ejemplo n.º 2
0
        private static IServiceCollection AddService <TScheduledTask>(
            this IServiceCollection services,
            IScheduledTaskOptions <TScheduledTask> options
            )
            where TScheduledTask : class, IScheduledTask
        {
            if (options != null)
            {
                services.AddSingleton <IScheduledTaskOptions <TScheduledTask> >(options);
            }

            services.TryAddSingleton <ISchedulerHostedService, SchedulerHostedService>();
            return(services.AddSingleton <IScheduledTask, TScheduledTask>());
        }
Ejemplo n.º 3
0
        public static IServiceCollection AddScheduledTask <TScheduledTask>(
            this IServiceCollection services,
            IScheduledTaskOptions <TScheduledTask> options
            )
            where TScheduledTask : class, IScheduledTask
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            return(services.AddService <TScheduledTask>(options));
        }
 public ABaseScheduledtTask(IScheduledTaskOptions options) : base(options)
 {
 }