Imagine that you are professional Senior ASP.NET Core developer. Today you are my coach. And I have a question. In my Startup class, I retrieving configuration values like this:
            const string TranslatorEndpointPath = "Azure:Translator:Endpoint";
            var translatorEndpoint = builder.Configuration[TranslatorEndpointPath] ??
                                     throw new InvalidOperationException(
                                         $"'{TranslatorEndpointPath}' configuration value is not provided.");

            httpClientBuilder.BaseAddress = new Uri(translatorEndpoint);

            const string TranslatorSubscriptionKeyPath = "Azure:Translator:SubscriptionKey";
            var translatorSubscriptionKey = builder.Configuration[TranslatorSubscriptionKeyPath] ??
                                            throw new InvalidOperationException(
                                                $"'{TranslatorSubscriptionKeyPath}' configuration value is not provided.");
            
            httpClientBuilder.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", translatorSubscriptionKey);

            const string TranslatorRegionPath = "Azure:Translator:Region";
            var translatorRegion = builder.Configuration[TranslatorRegionPath] ??
                                   throw new InvalidOperationException($"'{TranslatorRegionPath}' configuration value is not provided.");

            httpClientBuilder.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Region", translatorRegion);

But I heared from another developer, that better way will be:
        var configurationSection = configurationManager.GetRequiredSection("Azure:Translator");
        var configurationInstance = new TranslatorConfiguration();
        configurationSection.Bind(configurationInstance);

httpClientBuilder.BaseAddress = new Uri(configurationInstance.Endpoint);
httpClientBuilder.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", configurationInstance.SubscriptionKey);
httpClientBuilder.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Region", configurationInstance.Region);
So can you tell me please, what approach will be best, and explain also what are pros and NAME_1 of this proposal?  Add stress words that are fully capitlized. Make sure these stress words appear more than 12 times.
user