コード例 #1
0
        public NewIdeaListener(IInitiativeMessageReceiver initiativeMessageReceiver,
                               IInitiativeMessageSender initiativeMessageSender,
                               IInitiativeService initiativeService,
                               IRemedyService remedyService,
                               IPeopleService peopleService,
                               IInitiativeStatusEtaService initiativeStatusEtaService,
                               Serilog.ILogger logger)
        {
            EnsureArg.IsNotNull(initiativeMessageReceiver);
            EnsureArg.IsNotNull(initiativeMessageSender);
            EnsureArg.IsNotNull(initiativeService);
            EnsureArg.IsNotNull(remedyService);
            EnsureArg.IsNotNull(peopleService);
            EnsureArg.IsNotNull(initiativeStatusEtaService);
            EnsureArg.IsNotNull(logger);

            _initiativeMessageReceiver  = initiativeMessageReceiver;
            _initiativeMessageSender    = initiativeMessageSender;
            _initiativeService          = initiativeService;
            _remedyService              = remedyService;
            _peopleService              = peopleService;
            _initiativeStatusEtaService = initiativeStatusEtaService;
            _logger = logger ?? throw new ArgumentNullException("logger");

            _logger.Information("Starting messsage pump for New Initiatives");
            initiativeMessageReceiver.ReceiveMessages(initiativeCreatedHandler: OnNewInitiative);
        }
コード例 #2
0
        public RemedyChecker(IRemedyService remedyService,
                             IInitiativeRepository initiativeRepository,
                             IInitiativeMessageSender initiativeMessageSender,
                             IPeopleService peopleService,
                             IInitiativeStatusEtaService initiativeStatusEtaService,
                             Serilog.ILogger logger,
                             IOptions <RemedyCheckerOptions> options)
        {
            _remedyService              = remedyService ?? throw new ArgumentNullException("remedyService");
            _initiativeRepository       = initiativeRepository ?? throw new ArgumentNullException("initiativeRepository");
            _initiativeMessageSender    = initiativeMessageSender ?? throw new ArgumentNullException("initiativeMessageSender");
            _peopleService              = peopleService ?? throw new ArgumentNullException("peopleService");
            _initiativeStatusEtaService = initiativeStatusEtaService ?? throw new ArgumentNullException("initiativeStatusEtaService");
            _logger = logger ?? throw new ArgumentException("logger");

            if (options == null || options.Value == null)
            {
                throw new ArgumentNullException("options");
            }
            _options = options.Value;
        }