示例#1
0
        public PokemonController(
            ILogger <PokemonController> logger,
            IOptions <BaseConfiguration> config,
            IPokemonProvider pokemonProvider,
            ITextTransformProvider textTransformProvider
            )
        {
            // Assign injected servicers:
            _logger                = logger;
            _pokemonProvider       = pokemonProvider;
            _textTransformProvider = textTransformProvider;

            // Update services' configuration:
            _pokemonProvider.UpdateConfiguration(config.Value.PokemonConfiguration);
            _textTransformProvider.UpdateConfiguration(config.Value.TextTransformConfiguration);

            _logger.LogInformation(config.Value.ToString());
        }
 public PokemonController(IPokemonProvider pokemonProvider)
 {
     this.pokemonProvider = pokemonProvider;
 }