Class ApizrExtendedOptionsBuilder
Builder options available for extended registrations
Inheritance
Implements
Inherited Members
Namespace: Apizr.Extending.Configuring
Assembly: Apizr.Extensions.Microsoft.DependencyInjection.dll
Syntax
public class ApizrExtendedOptionsBuilder : IApizrExtendedOptionsBuilder, IApizrExtendedOptionsBuilder<IApizrExtendedOptions, IApizrExtendedOptionsBuilder>, IApizrExtendedOptionsBuilderBase<IApizrExtendedOptions, IApizrExtendedOptionsBuilder>, IApizrGlobalOptionsBuilderBase<IApizrExtendedOptions, IApizrExtendedOptionsBuilder>, IApizrExtendedOptionsBuilderBase, IApizrGlobalOptionsBuilderBase, IApizrExtendedCommonOptionsBuilder<IApizrExtendedOptions, IApizrExtendedOptionsBuilder>, IApizrExtendedCommonOptionsBuilderBase, IApizrGlobalCommonOptionsBuilderBase<IApizrExtendedOptions, IApizrExtendedOptionsBuilder>, IApizrGlobalCommonOptionsBuilderBase, IApizrExtendedProperOptionsBuilder<IApizrExtendedOptions, IApizrExtendedOptionsBuilder>, IApizrExtendedProperOptionsBuilderBase, IApizrGlobalProperOptionsBuilderBase<IApizrExtendedOptions, IApizrExtendedOptionsBuilder>, IApizrGlobalProperOptionsBuilderBase, IApizrExtendedSharedOptionsBuilder<IApizrExtendedOptions, IApizrExtendedOptionsBuilder>, IApizrExtendedSharedOptionsBuilderBase, IApizrGlobalSharedOptionsBuilderBase<IApizrExtendedOptions, IApizrExtendedOptionsBuilder>, IApizrGlobalSharedOptionsBuilderBase
Constructors
ApizrExtendedOptionsBuilder(ApizrExtendedOptions)
Declaration
public ApizrExtendedOptionsBuilder(ApizrExtendedOptions apizrOptions)
Parameters
Type | Name | Description |
---|---|---|
ApizrExtendedOptions | apizrOptions |
Fields
Options
Declaration
protected readonly ApizrExtendedOptions Options
Field Value
Type | Description |
---|---|
ApizrExtendedOptions |
Properties
ApizrOptions
Apizr common options
Declaration
public IApizrExtendedOptions ApizrOptions { get; }
Property Value
Type | Description |
---|---|
IApizrExtendedOptions |
Methods
AddDelegatingHandler(Func<IServiceProvider, IApizrOptionsBase, DelegatingHandler>)
Add a custom delegating handler
Declaration
public IApizrExtendedOptionsBuilder AddDelegatingHandler(Func<IServiceProvider, IApizrOptionsBase, DelegatingHandler> delegatingHandlerFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, IApizrOptionsBase, System.Net.Http.DelegatingHandler> | delegatingHandlerFactory | A delegating handler factory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
AddDelegatingHandler(Func<IServiceProvider, DelegatingHandler>)
Add a custom delegating handler
Declaration
public IApizrExtendedOptionsBuilder AddDelegatingHandler(Func<IServiceProvider, DelegatingHandler> delegatingHandlerFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, System.Net.Http.DelegatingHandler> | delegatingHandlerFactory | A delegating handler factory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
AddDelegatingHandler(DelegatingHandler)
Add a custom delegating handler
Declaration
public IApizrExtendedOptionsBuilder AddDelegatingHandler(DelegatingHandler delegatingHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Net.Http.DelegatingHandler | delegatingHandler | A delegating handler |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
ConfigureHttpClientBuilder(Action<IHttpClientBuilder>)
Adjust some HttpClient settings
Declaration
public IApizrExtendedOptionsBuilder ConfigureHttpClientBuilder(Action<IHttpClientBuilder> httpClientBuilder)
Parameters
Type | Name | Description |
---|---|---|
System.Action<Microsoft.Extensions.DependencyInjection.IHttpClientBuilder> | httpClientBuilder | The HttpClient builder |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithAuthenticationHandler(Func<HttpRequestMessage, Task<String>>)
Provide a method to refresh the authorization token when needed
Declaration
public IApizrExtendedOptionsBuilder WithAuthenticationHandler(Func<HttpRequestMessage, Task<string>> refreshTokenFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Net.Http.HttpRequestMessage, System.Threading.Tasks.Task<System.String>> | refreshTokenFactory | Refresh token method called when expired or empty |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithAuthenticationHandler<TAuthenticationHandler>(Func<IServiceProvider, IApizrOptionsBase, TAuthenticationHandler>)
Provide your own AuthenticationHandlerBase implementation
Declaration
public IApizrExtendedOptionsBuilder WithAuthenticationHandler<TAuthenticationHandler>(Func<IServiceProvider, IApizrOptionsBase, TAuthenticationHandler> authenticationHandlerFactory)
where TAuthenticationHandler : AuthenticationHandlerBase
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, IApizrOptionsBase, TAuthenticationHandler> | authenticationHandlerFactory | A |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
Type Parameters
Name | Description |
---|---|
TAuthenticationHandler | Your AuthenticationHandlerBase implementation |
WithAuthenticationHandler<TSettingsService>(Expression<Func<TSettingsService, String>>, Func<HttpRequestMessage, Task<String>>)
Provide your own settings management service and a method to refresh the token
Declaration
public IApizrExtendedOptionsBuilder WithAuthenticationHandler<TSettingsService>(Expression<Func<TSettingsService, string>> tokenProperty, Func<HttpRequestMessage, Task<string>> refreshTokenFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TSettingsService, System.String>> | tokenProperty | The token property used for saving |
System.Func<System.Net.Http.HttpRequestMessage, System.Threading.Tasks.Task<System.String>> | refreshTokenFactory | The method factory called to refresh the token |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
Type Parameters
Name | Description |
---|---|
TSettingsService | Your settings management service (saving/getting token) |
WithAuthenticationHandler<TSettingsService, TTokenService>(Expression<Func<TSettingsService, String>>, Expression<Func<TTokenService, HttpRequestMessage, Task<String>>>)
Provide your own settings management and token management services
Declaration
public IApizrExtendedOptionsBuilder WithAuthenticationHandler<TSettingsService, TTokenService>(Expression<Func<TSettingsService, string>> tokenProperty, Expression<Func<TTokenService, HttpRequestMessage, Task<string>>> refreshTokenMethod)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TSettingsService, System.String>> | tokenProperty | The token property used for saving |
System.Linq.Expressions.Expression<System.Func<TTokenService, System.Net.Http.HttpRequestMessage, System.Threading.Tasks.Task<System.String>>> | refreshTokenMethod | The method called to refresh the token |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
Type Parameters
Name | Description |
---|---|
TSettingsService | Your settings management service (saving/getting token) |
TTokenService | Your token management service (refreshing token) |
WithBaseAddress(Func<IServiceProvider, String>)
Define your web api base address (could be defined with WebApiAttribute)
Declaration
public IApizrExtendedOptionsBuilder WithBaseAddress(Func<IServiceProvider, string> baseAddressFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, System.String> | baseAddressFactory | Your web api base address factory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithBaseAddress(Func<IServiceProvider, Uri>)
Define your web api base address (could be defined with WebApiAttribute)
Declaration
public IApizrExtendedOptionsBuilder WithBaseAddress(Func<IServiceProvider, Uri> baseAddressFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, System.Uri> | baseAddressFactory | Your web api base address factory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithBaseAddress(String)
Define your web api base address (could be defined with WebApiAttribute)
Declaration
public IApizrExtendedOptionsBuilder WithBaseAddress(string baseAddress)
Parameters
Type | Name | Description |
---|---|---|
System.String | baseAddress | Your web api base address |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithBaseAddress(Uri)
Define your web api base address (could be defined with WebApiAttribute)
Declaration
public IApizrExtendedOptionsBuilder WithBaseAddress(Uri baseAddress)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | baseAddress | Your web api base address |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithBasePath(Func<IServiceProvider, String>)
Define your web api base path (could be defined with WebApiAttribute)
Declaration
public IApizrExtendedOptionsBuilder WithBasePath(Func<IServiceProvider, string> basePathFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, System.String> | basePathFactory | Your web api base path factory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithBasePath(String)
Define your web api base path (could be defined with WebApiAttribute)
Declaration
public IApizrExtendedOptionsBuilder WithBasePath(string basePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | basePath | Your web api base path |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithCacheHandler(ICacheHandler)
Provide a cache handler to cache data
Declaration
public IApizrExtendedOptionsBuilder WithCacheHandler(ICacheHandler cacheHandler)
Parameters
Type | Name | Description |
---|---|---|
ICacheHandler | cacheHandler | An ICacheHandler mapping implementation instance |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithCacheHandler(Func<IServiceProvider, ICacheHandler>)
Provide a cache handler to cache data
Declaration
public IApizrExtendedOptionsBuilder WithCacheHandler(Func<IServiceProvider, ICacheHandler> cacheHandlerFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, ICacheHandler> | cacheHandlerFactory | A ICacheHandler mapping implementation factory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithCacheHandler(Type)
Provide a cache handler to cache data
Declaration
public IApizrExtendedOptionsBuilder WithCacheHandler(Type cacheHandlerType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | cacheHandlerType | Type of your ICacheHandler mapping implementation |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithCacheHandler<TCacheHandler>()
Provide a cache handler to cache data
Declaration
public IApizrExtendedOptionsBuilder WithCacheHandler<TCacheHandler>()
where TCacheHandler : class, ICacheHandler
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
Type Parameters
Name | Description |
---|---|
TCacheHandler | Your ICacheHandler mapping implementation |
WithConnectivityHandler(IConnectivityHandler)
Provide a connectivity handler to check connectivity before sending a request
Declaration
public IApizrExtendedOptionsBuilder WithConnectivityHandler(IConnectivityHandler connectivityHandler)
Parameters
Type | Name | Description |
---|---|---|
IConnectivityHandler | connectivityHandler | An IConnectivityHandler mapping implementation instance |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithConnectivityHandler(Func<Boolean>)
Provide a function to invoke while checking connectivity
Declaration
public IApizrExtendedOptionsBuilder WithConnectivityHandler(Func<bool> connectivityCheckingFunction)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Boolean> | connectivityCheckingFunction | A function to invoke while checking connectivity |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithConnectivityHandler(Func<IServiceProvider, IConnectivityHandler>)
Provide a connectivity handler to check connectivity before sending a request
Declaration
public IApizrExtendedOptionsBuilder WithConnectivityHandler(Func<IServiceProvider, IConnectivityHandler> connectivityHandlerFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, IConnectivityHandler> | connectivityHandlerFactory | A IConnectivityHandler mapping implementation factory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithConnectivityHandler(Type)
Provide a connectivity handler to check connectivity before sending a request
Declaration
public IApizrExtendedOptionsBuilder WithConnectivityHandler(Type connectivityHandlerType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | connectivityHandlerType | Type of your IConnectivityHandler mapping implementation |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithConnectivityHandler<TConnectivityHandler>()
Provide a connectivity handler to check connectivity before sending a request
Declaration
public IApizrExtendedOptionsBuilder WithConnectivityHandler<TConnectivityHandler>()
where TConnectivityHandler : class, IConnectivityHandler
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
Type Parameters
Name | Description |
---|---|
TConnectivityHandler | Your IConnectivityHandler mapping implementation |
WithConnectivityHandler<TConnectivityHandler>(Expression<Func<TConnectivityHandler, Boolean>>)
Provide a connectivity handler to check connectivity before sending a request
Declaration
public IApizrExtendedOptionsBuilder WithConnectivityHandler<TConnectivityHandler>(Expression<Func<TConnectivityHandler, bool>> factory)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TConnectivityHandler, System.Boolean>> | factory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
Type Parameters
Name | Description |
---|---|
TConnectivityHandler | Your connectivity checking service |
WithHttpClientHandler(Func<IServiceProvider, HttpClientHandler>)
Provide a custom HttpClientHandler
Declaration
public IApizrExtendedOptionsBuilder WithHttpClientHandler(Func<IServiceProvider, HttpClientHandler> httpClientHandlerFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, System.Net.Http.HttpClientHandler> | httpClientHandlerFactory | An System.Net.Http.HttpClientHandler instance factory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithHttpClientHandler(HttpClientHandler)
Provide a custom HttpClientHandler
Declaration
public IApizrExtendedOptionsBuilder WithHttpClientHandler(HttpClientHandler httpClientHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Net.Http.HttpClientHandler | httpClientHandler | An System.Net.Http.HttpClientHandler instance |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithLogging(HttpTracerMode, HttpMessageParts, LogLevel[])
Configure logging level for the api
Declaration
public IApizrExtendedOptionsBuilder WithLogging(HttpTracerMode httpTracerMode = HttpTracerMode.Everything, HttpMessageParts trafficVerbosity = HttpMessageParts.All, params LogLevel[] logLevels)
Parameters
Type | Name | Description |
---|---|---|
HttpTracerMode | httpTracerMode | |
HttpMessageParts | trafficVerbosity | Http traffic tracing verbosity (default: All) |
Microsoft.Extensions.Logging.LogLevel[] | logLevels | Log levels to apply while writing (default: Information) |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithLogging(Func<IServiceProvider, HttpTracerMode>, Func<IServiceProvider, HttpMessageParts>, Func<IServiceProvider, LogLevel[]>)
Define http traffic tracing verbosity and log level (could be defined with TraceAttribute)
Declaration
public IApizrExtendedOptionsBuilder WithLogging(Func<IServiceProvider, HttpTracerMode> httpTracerModeFactory, Func<IServiceProvider, HttpMessageParts> trafficVerbosityFactory, Func<IServiceProvider, LogLevel[]> logLevelFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, HttpTracerMode> | httpTracerModeFactory | Http traffic tracing mode factory |
System.Func<System.IServiceProvider, HttpMessageParts> | trafficVerbosityFactory | Http traffic tracing verbosity factory |
System.Func<System.IServiceProvider, Microsoft.Extensions.Logging.LogLevel[]> | logLevelFactory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithMappingHandler(IMappingHandler)
Provide a mapping handler to map entities
Declaration
public IApizrExtendedOptionsBuilder WithMappingHandler(IMappingHandler mappingHandler)
Parameters
Type | Name | Description |
---|---|---|
IMappingHandler | mappingHandler | An IMappingHandler mapping implementation instance |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithMappingHandler(Func<IServiceProvider, IMappingHandler>)
Provide a mapping handler to auto map entities during mediation
Declaration
public IApizrExtendedOptionsBuilder WithMappingHandler(Func<IServiceProvider, IMappingHandler> mappingHandlerFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, IMappingHandler> | mappingHandlerFactory | A IMappingHandler mapping implementation factory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithMappingHandler(Type)
Provide a mapping handler to auto map entities during mediation
Declaration
public IApizrExtendedOptionsBuilder WithMappingHandler(Type mappingHandlerType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | mappingHandlerType | Type of your IMappingHandler mapping implementation |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithMappingHandler<TMappingHandler>()
Provide a mapping handler to auto map entities during mediation
Declaration
public IApizrExtendedOptionsBuilder WithMappingHandler<TMappingHandler>()
where TMappingHandler : class, IMappingHandler
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
Type Parameters
Name | Description |
---|---|
TMappingHandler | Your IMappingHandler mapping implementation |
WithRefitSettings(RefitSettings)
Provide some Refit specific settings
Declaration
public IApizrExtendedOptionsBuilder WithRefitSettings(RefitSettings refitSettings)
Parameters
Type | Name | Description |
---|---|---|
Refit.RefitSettings | refitSettings | A Refit.RefitSettings instance |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |
WithRefitSettings(Func<IServiceProvider, RefitSettings>)
Provide some Refit specific settings
Declaration
public IApizrExtendedOptionsBuilder WithRefitSettings(Func<IServiceProvider, RefitSettings> refitSettingsFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.IServiceProvider, Refit.RefitSettings> | refitSettingsFactory | A Refit.RefitSettings instance factory |
Returns
Type | Description |
---|---|
IApizrExtendedOptionsBuilder |