コード例 #1
0
        /// <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);
        }
コード例 #2
0
 protected ServiceEndpointManagerBase(IServiceEndpointOptions options, ILogger logger)
     : this(ServiceEndpointUtility.Merge(options.ConnectionString, options.Endpoints), logger)
 {
 }
コード例 #3
0
        private void OnChange(ServiceOptions options)
        {
            Log.DetectConfigurationChanges(_logger);

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