private static IEnumerable <ServiceEndpoint> GetEndpoints(IServiceEndpointOptions options) { if (options == null) { yield break; } var endpoints = options.Endpoints; var connectionString = options.ConnectionString; // ConnectionString can be set by custom Csonfigure // Return both the one from ConnectionString and from Endpoints // TODO: Better way if Endpoints already contains ConnectionString one? if (!string.IsNullOrEmpty(connectionString)) { yield return(new ServiceEndpoint(options.ConnectionString)); } if (endpoints != null) { foreach (var endpoint in endpoints) { yield return(endpoint); } } }
protected static IEnumerable <ServiceEndpoint> GetEndpoints(IServiceEndpointOptions options) { if (options == null) { yield break; } var endpoints = options.Endpoints; var connectionString = options.ConnectionString; if (!string.IsNullOrEmpty(connectionString)) { yield return(new ServiceEndpoint(options.ConnectionString)); } // ConnectionString can be set by custom Configure // Return both the one from ConnectionString and from Endpoints if (endpoints != null) { foreach (var endpoint in endpoints) { yield return(endpoint); } } }
private static IEnumerable <ServiceEndpoint> GetEndpoints(IServiceEndpointOptions options) { if (options == null) { yield break; } var endpoints = options.Endpoints; var connectionString = options.ConnectionString; // ConnectionString can be set by custom Configure // Return both the one from ConnectionString and from Endpoints // when the one from connectionString is not included in Endpoints var connectionStringIncluded = false; if (endpoints != null) { foreach (var endpoint in endpoints) { if (endpoint.ConnectionString == connectionString) { connectionStringIncluded = true; } yield return(endpoint); } } if (!string.IsNullOrEmpty(connectionString) && !connectionStringIncluded) { yield return(new ServiceEndpoint(options.ConnectionString)); } }
public ServiceConnectionContainerFactory( IServiceConnectionFactory serviceConnectionFactory, IServiceEndpointManager serviceEndpointManager, IMessageRouter router, IServiceEndpointOptions options, ILoggerFactory loggerFactory) { _serviceConnectionFactory = serviceConnectionFactory; _serviceEndpointManager = serviceEndpointManager ?? throw new ArgumentNullException(nameof(serviceEndpointManager)); _router = router ?? throw new ArgumentNullException(nameof(router)); _options = options; _loggerFactory = loggerFactory; }
public ServiceConnectionContainerFactory( IServiceConnectionFactory serviceConnectionFactory, IServiceEndpointManager serviceEndpointManager, IMessageRouter router, IServiceEndpointOptions options, IServerNameProvider nameProvider, IClientConnectionLifetimeManager lifetime, ILoggerFactory loggerFactory) { _serviceConnectionFactory = serviceConnectionFactory; _serviceEndpointManager = serviceEndpointManager ?? throw new ArgumentNullException(nameof(serviceEndpointManager)); _router = router ?? throw new ArgumentNullException(nameof(router)); _options = options; _nameProvider = nameProvider; _lifetime = lifetime; _loggerFactory = loggerFactory; }
protected ServiceEndpointManagerBase(IServiceEndpointOptions options, ILogger logger) : this(GetEndpoints(options), logger) { }
protected ServiceEndpointManagerBase(IServiceEndpointOptions options, ILogger logger) : this(ServiceEndpointUtility.Merge(options.ConnectionString, options.Endpoints), logger) { }
protected ServiceEndpointManagerBase(IServiceEndpointOptions options, ILogger logger) : this(options.GetMergedEndpoints(), logger) { }
public ServiceEndpointManagerBase(IServiceEndpointOptions options, ILogger logger) : this(GetEndpoints(options).ToArray(), logger) { }