Class ServiceCollectionDynamicHttpClientProxyExtensions
Inheritance
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: Volo.Abp.Http.Client.dll
Syntax
public static class ServiceCollectionDynamicHttpClientProxyExtensions : object
Methods
AddHttpClientFactoryAndPolicy(IServiceCollection, String, Action<IHttpClientBuilder>)
Use IHttpClientFactory and polly
Declaration
public static IServiceCollection AddHttpClientFactoryAndPolicy(this IServiceCollection services, string remoteServiceConfigurationName = null, Action<IHttpClientBuilder> configureHttpClientBuilder = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | Service collection |
| System.String | remoteServiceConfigurationName | The name of the remote service configuration to be used by the HTTP Client proxies. See AbpRemoteServiceOptions. |
| Action<IHttpClientBuilder> | configureHttpClientBuilder | A delegate that is used to configure an Microsoft.Extensions.DependencyInjection.IHttpClientBuilder. |
Returns
| Type | Description |
|---|---|
| IServiceCollection |
AddHttpClientProxies(IServiceCollection, Assembly, String, Boolean, Action<IHttpClientBuilder>)
Registers HTTP Client Proxies for all public interfaces
extend the assembly.
Declaration
public static IServiceCollection AddHttpClientProxies(this IServiceCollection services, Assembly assembly, string remoteServiceConfigurationName = null, bool asDefaultServices = true, Action<IHttpClientBuilder> configureHttpClientBuilder = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | Service collection |
| Assembly | assembly | The assembly containing the service interfaces |
| System.String | remoteServiceConfigurationName | The name of the remote service configuration to be used by the HTTP Client proxies. See AbpRemoteServiceOptions. |
| System.Boolean | asDefaultServices | True, to register the HTTP client proxy as the default implementation for the services. |
| Action<IHttpClientBuilder> | configureHttpClientBuilder | A delegate that is used to configure an Microsoft.Extensions.DependencyInjection.IHttpClientBuilder. |
Returns
| Type | Description |
|---|---|
| IServiceCollection |
AddHttpClientProxy(IServiceCollection, Type, String, Boolean)
Registers HTTP Client Proxy for given service type.
Declaration
public static IServiceCollection AddHttpClientProxy(this IServiceCollection services, Type type, string remoteServiceConfigurationName = null, bool asDefaultService = true)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | Service collection |
| Type | type | Type of the service |
| System.String | remoteServiceConfigurationName | The name of the remote service configuration to be used by the HTTP Client proxy. See AbpRemoteServiceOptions. |
| System.Boolean | asDefaultService | True, to register the HTTP client proxy as the default implementation for the service |
Returns
| Type | Description |
|---|---|
| IServiceCollection |
AddHttpClientProxy<T>(IServiceCollection, String, Boolean, Action<IHttpClientBuilder>)
Registers HTTP Client Proxy for given service type T.
Declaration
public static IServiceCollection AddHttpClientProxy<T>(this IServiceCollection services, string remoteServiceConfigurationName = null, bool asDefaultService = true, Action<IHttpClientBuilder> configureHttpClientBuilder = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | Service collection |
| System.String | remoteServiceConfigurationName | The name of the remote service configuration to be used by the HTTP Client proxy. See AbpRemoteServiceOptions. |
| System.Boolean | asDefaultService | True, to register the HTTP client proxy as the default implementation for the service |
| Action<IHttpClientBuilder> | configureHttpClientBuilder | A delegate that is used to configure an Microsoft.Extensions.DependencyInjection.IHttpClientBuilder. |
Returns
| Type | Description |
|---|---|
| IServiceCollection |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the service |