示例#1
0
        public BenchmarkService(
            ILogger <BenchmarkService> logger,
            IOptions <Configuration.Configuration> configuration,
            IHostApplicationLifetime appLifetime,
            ICalculationHandler calculationHandler,
            IValueProvider valueProvider,
            IRequestClient requestClient,
            IReporter reporter)
        {
            _logger             = logger;
            _calculationHandler = calculationHandler;
            _valueProvider      = valueProvider;
            _requestClient      = requestClient;
            _reporter           = reporter;
            _configuration      = configuration.Value;

            _cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(appLifetime.ApplicationStopping);

            Environment.ExitCode = 0;

            _cancellationTokenSource.Token.Register(() =>
            {
                _logger.LogInformation($"Shutting down {nameof(BenchmarkService)}..");
                appLifetime.StopApplication();
            });
        }
示例#2
0
        public DataHandler(IPerformLookup performLookup, IViewModelDataAdapter viewModelAdapter, ICalculationHandler calculationHandler)
        {
            this.performLookup      = performLookup;
            this.viewModelAdapter   = viewModelAdapter;
            this.calculationHandler = calculationHandler;

            InlandDepotList         = ConfigurationManager.AppSettings["InlandDepotList"];
            DutyFreeCountryCodeList = ConfigurationManager.AppSettings["DutyFreeCountryCodeList"].Split(';');
        }
 public ViewModelDataAdapter(ILog logger, ICalculationHandler calculationHandler)
 {
     this.logger             = logger;
     this.calculationHandler = calculationHandler;
 }
 public CalcController(ILogger <CalcController> logger, ICalculationHandler handler)
 {
     _logger      = logger;
     this.handler = handler;
 }