コード例 #1
0
        public IndexModel(IGreetingService greetingService, IOptionsSnapshot <HomePageConfiguration> options,
                          IWeatherForecaster weatherForecaster)
        {
            _greetingService       = greetingService;
            _homePageConfiguration = options.Value;
            _weatherForecaster     = weatherForecaster;

            GreetingColor = _greetingService.GreetingColor ?? "black";
        }
コード例 #2
0
        public IndexModel(IWeatherForecaster weatherForecaster, IGreetingService greetingService,
                          IProductsApiClient productsApiClient,
                          IOptionsSnapshot <HomePageConfiguration> options)

        {
            _weatherForecaster = weatherForecaster;
            _greetingService   = greetingService;
            _productsApiClient = productsApiClient;
            _homePageConfig    = options.Value;

            GreetingColour = _greetingService.GreetingColour ?? "black";
        }