Esempio n. 1
0
 public TaskHandlerRegistrationService(
     ILogger <TaskHandlerRegistrationService> logger,
     IEnumerable <ITaskHandler> taskHandlers,
     ITaskHandlerRegistry taskHandlerRegistry
     )
 {
     _logger              = logger ?? throw new ArgumentNullException(nameof(logger));
     _taskHandlers        = taskHandlers ?? throw new ArgumentNullException(nameof(taskHandlers));
     _taskHandlerRegistry = taskHandlerRegistry
                            ?? throw new ArgumentNullException(nameof(taskHandlerRegistry));
 }
 public TaskRunnerHostedService(
     ITaskRepository taskRepository,
     ITaskHandlerRegistry taskHandlerRegistry,
     ILeasedLockProvider leasedLockProvider,
     ILogger <TaskRunnerHostedService> logger)
 {
     _taskRepository      = taskRepository ?? throw new ArgumentNullException(nameof(taskRepository));
     _taskHandlerRegistry = taskHandlerRegistry ?? throw new ArgumentNullException(nameof(taskHandlerRegistry));
     _leasedLockProvider  = leasedLockProvider ?? throw new ArgumentNullException(nameof(leasedLockProvider));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _Random = new Random();
 }