/// <param name="configuration"></param>
        /// <param name="sectionName"></param>
        /// <param name="includeNoSuffixEndpoint">Include the service endpoint whose key has no suffix. </param>
        public static IEnumerable <ServiceEndpoint> GetEndpoints(this IConfiguration configuration, string sectionName, bool includeNoSuffixEndpoint = false)
        {
            var section           = configuration.GetSection(sectionName);
            var suffixedEndpoints = section.AsEnumerable(true)
                                    .Where(entry => !string.IsNullOrEmpty(entry.Value))
                                    .Select(entry => new ServiceEndpoint(entry.Key, entry.Value));

            return(includeNoSuffixEndpoint ? ServiceEndpointUtility.Merge(configuration[sectionName], suffixedEndpoints) : suffixedEndpoints);
        }
Exemple #2
0
 protected ServiceEndpointManagerBase(IServiceEndpointOptions options, ILogger logger)
     : this(ServiceEndpointUtility.Merge(options.ConnectionString, options.Endpoints), logger)
 {
 }
        private void OnChange(ServiceOptions options)
        {
            Log.DetectConfigurationChanges(_logger);

            ReloadServiceEndpointsAsync(ServiceEndpointUtility.Merge(options.ConnectionString, options.Endpoints));
        }