Class DiscoveryWebHostBuilderExtensions
Inheritance
Namespace: Steeltoe.Discovery.Client
Assembly: Steeltoe.Discovery.ClientCore.dll
Syntax
public static class DiscoveryWebHostBuilderExtensions : object
Methods
| Edit this page View SourceAddDiscoveryClient(IWebHostBuilder)
Adds service discovery to your application. This method can be used in place of configuration via your Startup class.
Uses reflection to find discovery client packages. If no package is found, a Steeltoe.Discovery.Client.SimpleClients.NoOpDiscoveryClient will be configured
Declaration
public static IWebHostBuilder AddDiscoveryClient(this IWebHostBuilder hostBuilder)
Parameters
Type | Name | Description |
---|---|---|
IWebHostBuilder | hostBuilder | Your HostBuilder |
Returns
Type | Description |
---|---|
IWebHostBuilder |
Remarks
Also configures named HttpClients "DiscoveryRandom" and "DiscoveryRoundRobin" for automatic injection
AddServiceDiscovery(IWebHostBuilder, Action<DiscoveryClientBuilder>)
Adds service discovery to your application. This method can be used in place of configuration via your Startup class.
If optionsAction
is not provided, a Steeltoe.Discovery.Client.SimpleClients.NoOpDiscoveryClient will be configured
Declaration
public static IWebHostBuilder AddServiceDiscovery(this IWebHostBuilder hostBuilder, Action<DiscoveryClientBuilder> optionsAction)
Parameters
Type | Name | Description |
---|---|---|
IWebHostBuilder | hostBuilder | Your HostBuilder |
Action<DiscoveryClientBuilder> | optionsAction | Select the discovery client implementation |
Returns
Type | Description |
---|---|
IWebHostBuilder |
Remarks
Also configures named HttpClients "DiscoveryRandom" and "DiscoveryRoundRobin" for automatic injection