Interface IApizrSharedRegistrationOptionsBuilder<TApizrOptions, TApizrOptionsBuilder>
- Namespace
- Apizr.Configuring.Shared
- Assembly
- Apizr.dll
Builder options available at both common and proper level for static registrations
public interface IApizrSharedRegistrationOptionsBuilder<out TApizrOptions, out TApizrOptionsBuilder> : IApizrSharedRegistrationOptionsBuilderBase<TApizrOptions, TApizrOptionsBuilder>, IApizrGlobalSharedRegistrationOptionsBuilderBase<TApizrOptions, TApizrOptionsBuilder>, IApizrGlobalSharedOptionsBuilderBase<TApizrOptions, TApizrOptionsBuilder>, IApizrSharedRegistrationOptionsBuilder, IApizrSharedRegistrationOptionsBuilderBase, IApizrGlobalSharedRegistrationOptionsBuilderBase, IApizrGlobalSharedOptionsBuilderBase where TApizrOptions : IApizrSharedRegistrationOptionsBase where TApizrOptionsBuilder : IApizrSharedRegistrationOptionsBuilderBase<out TApizrOptions, out TApizrOptionsBuilder>
Type Parameters
TApizrOptions
TApizrOptionsBuilder
- Inherited Members
- Extension Methods
Methods
ConfigureHttpClient(Action<HttpClient>, ApizrDuplicateStrategy)
Configure HttpClient
TApizrOptionsBuilder ConfigureHttpClient(Action<HttpClient> configureHttpClient, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Merge)
Parameters
configureHttpClient
Action<HttpClient>The configuration builder
strategy
ApizrDuplicateStrategyThe duplicate strategy if there's another one already (default: Merge)
Returns
- TApizrOptionsBuilder
WithAuthenticationHandler<TAuthenticationHandler>(Func<IApizrManagerOptionsBase, TAuthenticationHandler>)
Provide your own AuthenticationHandlerBase implementation factory
TApizrOptionsBuilder WithAuthenticationHandler<TAuthenticationHandler>(Func<IApizrManagerOptionsBase, TAuthenticationHandler> authenticationHandlerFactory) where TAuthenticationHandler : AuthenticationHandlerBase
Parameters
authenticationHandlerFactory
Func<IApizrManagerOptionsBase, TAuthenticationHandler>A
TAuthenticationHandler
instance factory
Returns
- TApizrOptionsBuilder
Type Parameters
TAuthenticationHandler
Your AuthenticationHandlerBase implementation
WithAuthenticationHandler<TTokenService>(Func<TTokenService>, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own token management services
TApizrOptionsBuilder WithAuthenticationHandler<TTokenService>(Func<TTokenService> tokenServiceFactory, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenExpression)
Parameters
tokenServiceFactory
Func<TTokenService>A
TTokenService
instance factoryrefreshTokenExpression
Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>The method called to refresh the token
Returns
- TApizrOptionsBuilder
Type Parameters
TTokenService
Your token management service (refreshing token)
WithAuthenticationHandler<TSettingsService>(Func<TSettingsService>, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>)
Provide your own settings management service
TApizrOptionsBuilder WithAuthenticationHandler<TSettingsService>(Func<TSettingsService> settingsServiceFactory, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>> getTokenExpression)
Parameters
settingsServiceFactory
Func<TSettingsService>A
TSettingsService
instance factorygetTokenExpression
Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>The get only token expression
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (getting constant token)
WithAuthenticationHandler<TSettingsService>(Func<TSettingsService>, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>)
Provide your own settings management service
TApizrOptionsBuilder WithAuthenticationHandler<TSettingsService>(Func<TSettingsService> settingsServiceFactory, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>> getTokenExpression, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>> setTokenExpression)
Parameters
settingsServiceFactory
Func<TSettingsService>A
TSettingsService
instance factorygetTokenExpression
Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>The get token expression
setTokenExpression
Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>The set token expression
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (saving/getting token)
WithAuthenticationHandler<TAuthService>(Func<TAuthService>, Expression<Func<TAuthService, HttpRequestMessage, CancellationToken, Task<string>>>, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task>>, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own auth management service
TApizrOptionsBuilder WithAuthenticationHandler<TAuthService>(Func<TAuthService> authServiceFactory, Expression<Func<TAuthService, HttpRequestMessage, CancellationToken, Task<string>>> getTokenExpression, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task>> setTokenExpression, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenExpression)
Parameters
authServiceFactory
Func<TAuthService>A
TAuthService
instance factorygetTokenExpression
Expression<Func<TAuthService, HttpRequestMessage, CancellationToken, Task<string>>>The get token expression
setTokenExpression
Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task>>The set token expression
refreshTokenExpression
Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>>The method called to refresh the token
Returns
- TApizrOptionsBuilder
Type Parameters
TAuthService
Your auth management service (saving/getting/refreshing token)
WithAuthenticationHandler<TSettingsService>(Func<TSettingsService>, Expression<Func<TSettingsService, string>>)
Provide your own settings management service with its token source
TApizrOptionsBuilder WithAuthenticationHandler<TSettingsService>(Func<TSettingsService> settingsServiceFactory, Expression<Func<TSettingsService, string>> tokenPropertyExpression)
Parameters
settingsServiceFactory
Func<TSettingsService>A
TSettingsService
instance factorytokenPropertyExpression
Expression<Func<TSettingsService, string>>The token property to get from and set to
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (getting token)
WithAuthenticationHandler<TAuthService>(Func<TAuthService>, Expression<Func<TAuthService, string>>, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own auth management service
TApizrOptionsBuilder WithAuthenticationHandler<TAuthService>(Func<TAuthService> authServiceFactory, Expression<Func<TAuthService, string>> tokenPropertyExpression, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenMethod)
Parameters
authServiceFactory
Func<TAuthService>A
TAuthService
instance factorytokenPropertyExpression
Expression<Func<TAuthService, string>>The token property to get from and set to
refreshTokenMethod
Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>>The method called to refresh the token
Returns
- TApizrOptionsBuilder
Type Parameters
TAuthService
Your auth management service (saving/getting/refreshing token)
WithAuthenticationHandler<TTokenService>(TTokenService, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own token management services
TApizrOptionsBuilder WithAuthenticationHandler<TTokenService>(TTokenService tokenService, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenExpression)
Parameters
tokenService
TTokenServiceA
TTokenService
instancerefreshTokenExpression
Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>The method called to refresh the token
Returns
- TApizrOptionsBuilder
Type Parameters
TTokenService
Your token management service (refreshing token)
WithAuthenticationHandler<TSettingsService>(TSettingsService, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>)
Provide your own settings management service
TApizrOptionsBuilder WithAuthenticationHandler<TSettingsService>(TSettingsService settingsService, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>> getTokenExpression)
Parameters
settingsService
TSettingsServiceA
TSettingsService
instancegetTokenExpression
Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>The get only token expression
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (getting constant token)
WithAuthenticationHandler<TSettingsService>(TSettingsService, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>)
Provide your own settings management service
TApizrOptionsBuilder WithAuthenticationHandler<TSettingsService>(TSettingsService settingsService, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>> getTokenExpression, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>> setTokenExpression)
Parameters
settingsService
TSettingsServiceA
TSettingsService
instancegetTokenExpression
Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>The get token expression
setTokenExpression
Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>The set token expression
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (saving/getting token)
WithAuthenticationHandler<TAuthService>(TAuthService, Expression<Func<TAuthService, HttpRequestMessage, CancellationToken, Task<string>>>, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task>>, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own settings management and token management services
TApizrOptionsBuilder WithAuthenticationHandler<TAuthService>(TAuthService authService, Expression<Func<TAuthService, HttpRequestMessage, CancellationToken, Task<string>>> getTokenExpression, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task>> setTokenExpression, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenExpression)
Parameters
authService
TAuthServiceA
TAuthService
instancegetTokenExpression
Expression<Func<TAuthService, HttpRequestMessage, CancellationToken, Task<string>>>The get token expression
setTokenExpression
Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task>>The set token expression
refreshTokenExpression
Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>>The method called to refresh the token
Returns
- TApizrOptionsBuilder
Type Parameters
TAuthService
Your auth management service (saving/getting/refreshing token)
WithAuthenticationHandler<TSettingsService>(TSettingsService, Expression<Func<TSettingsService, string>>)
Provide your own settings management service with its token source
TApizrOptionsBuilder WithAuthenticationHandler<TSettingsService>(TSettingsService settingsService, Expression<Func<TSettingsService, string>> tokenPropertyExpression)
Parameters
settingsService
TSettingsServiceA
TSettingsService
instancetokenPropertyExpression
Expression<Func<TSettingsService, string>>The token property to get from and set to
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (getting token)
WithAuthenticationHandler<TAuthService>(TAuthService, Expression<Func<TAuthService, string>>, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own auth management service
TApizrOptionsBuilder WithAuthenticationHandler<TAuthService>(TAuthService authService, Expression<Func<TAuthService, string>> tokenPropertyExpression, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenMethod)
Parameters
authService
TAuthServiceA
TAuthService
instancetokenPropertyExpression
Expression<Func<TAuthService, string>>The token property to get from and set to
refreshTokenMethod
Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>>The method called to refresh the token
Returns
- TApizrOptionsBuilder
Type Parameters
TAuthService
Your auth management service (saving/getting/refreshing token)
WithAuthenticationHandler<TSettingsService, TTokenService>(Func<TSettingsService>, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>, Func<TTokenService>, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own settings management and token management services
TApizrOptionsBuilder WithAuthenticationHandler<TSettingsService, TTokenService>(Func<TSettingsService> settingsServiceFactory, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>> getTokenExpression, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>> setTokenExpression, Func<TTokenService> tokenServiceFactory, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenExpression)
Parameters
settingsServiceFactory
Func<TSettingsService>A
TSettingsService
instance factorygetTokenExpression
Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>The get token expression
setTokenExpression
Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>The set token expression
tokenServiceFactory
Func<TTokenService>A
TTokenService
instance factoryrefreshTokenExpression
Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>The method called to refresh the token
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (saving/getting token)
TTokenService
Your token management service (refreshing token)
WithAuthenticationHandler<TSettingsService, TTokenService>(Func<TSettingsService>, Expression<Func<TSettingsService, string>>, Func<TTokenService>, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own settings management and token management services
TApizrOptionsBuilder WithAuthenticationHandler<TSettingsService, TTokenService>(Func<TSettingsService> settingsServiceFactory, Expression<Func<TSettingsService, string>> tokenPropertyExpression, Func<TTokenService> tokenServiceFactory, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenMethod)
Parameters
settingsServiceFactory
Func<TSettingsService>A
TSettingsService
instance factorytokenPropertyExpression
Expression<Func<TSettingsService, string>>The token property to get from and set to
tokenServiceFactory
Func<TTokenService>A
TTokenService
instance factoryrefreshTokenMethod
Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>The method called to refresh the token
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (saving/getting token)
TTokenService
Your token management service (refreshing token)
WithAuthenticationHandler<TSettingsService, TTokenService>(TSettingsService, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>, TTokenService, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own settings management and token management services
TApizrOptionsBuilder WithAuthenticationHandler<TSettingsService, TTokenService>(TSettingsService settingsService, Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>> getTokenExpression, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>> setTokenExpression, TTokenService tokenService, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenExpression)
Parameters
settingsService
TSettingsServiceA
TSettingsService
instancegetTokenExpression
Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>The get token expression
setTokenExpression
Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>The set token expression
tokenService
TTokenServiceA
TTokenService
instancerefreshTokenExpression
Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>The method called to refresh the token
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (saving/getting token)
TTokenService
Your token management service (refreshing token)
WithAuthenticationHandler<TSettingsService, TTokenService>(TSettingsService, Expression<Func<TSettingsService, string>>, TTokenService, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own settings management and token management services
TApizrOptionsBuilder WithAuthenticationHandler<TSettingsService, TTokenService>(TSettingsService settingsService, Expression<Func<TSettingsService, string>> tokenPropertyExpression, TTokenService tokenService, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenMethod)
Parameters
settingsService
TSettingsServiceA
TSettingsService
instancetokenPropertyExpression
Expression<Func<TSettingsService, string>>The token property to get from and set to
tokenService
TTokenServiceA
TTokenService
instancerefreshTokenMethod
Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>The method called to refresh the token
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (saving/getting token)
TTokenService
Your token management service (refreshing token)
WithBaseAddress(Func<string>, ApizrDuplicateStrategy)
Define your web api base address (could be defined with WebApiAttribute)
TApizrOptionsBuilder WithBaseAddress(Func<string> baseAddressFactory, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)
Parameters
baseAddressFactory
Func<string>Your web api base address factory
strategy
ApizrDuplicateStrategyThe duplicate strategy if there's any other already (default: Replace)
Returns
- TApizrOptionsBuilder
WithBaseAddress(Func<Uri>, ApizrDuplicateStrategy)
Define your web api base address (could be defined with WebApiAttribute)
TApizrOptionsBuilder WithBaseAddress(Func<Uri> baseAddressFactory, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)
Parameters
baseAddressFactory
Func<Uri>Your web api base address factory
strategy
ApizrDuplicateStrategyThe duplicate strategy if there's any other already (default: Replace)
Returns
- TApizrOptionsBuilder
WithBasePath(Func<string>, ApizrDuplicateStrategy)
Define your web api base path (could be defined with WebApiAttribute)
TApizrOptionsBuilder WithBasePath(Func<string> basePathFactory, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)
Parameters
basePathFactory
Func<string>Your web api base path factory
strategy
ApizrDuplicateStrategyThe duplicate strategy if there's any other already (default: Replace)
Returns
- TApizrOptionsBuilder
WithDelegatingHandler<THandler>(Func<IApizrManagerOptionsBase, THandler>, ApizrDuplicateStrategy)
Add a custom delegating handler inheriting from DelegatingHandler (serial call)
TApizrOptionsBuilder WithDelegatingHandler<THandler>(Func<IApizrManagerOptionsBase, THandler> delegatingHandlerFactory, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add) where THandler : DelegatingHandler
Parameters
delegatingHandlerFactory
Func<IApizrManagerOptionsBase, THandler>A delegating handler factory
strategy
ApizrDuplicateStrategyThe duplicate strategy if there's any other already (default: Add)
Returns
- TApizrOptionsBuilder
Type Parameters
THandler
WithExCatching<THandler>(Func<THandler>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
TApizrOptionsBuilder WithExCatching<THandler>(Func<THandler> exceptionHandlerFactory, bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace) where THandler : IApizrExceptionHandler
Parameters
exceptionHandlerFactory
Func<THandler>The exception handler called back and returning handled boolean flag Task
letThrowOnHandledException
boolLet throw potential exception even if it's handled (default: true)
strategy
ApizrDuplicateStrategyThe duplicate strategy if there's another callback already (default: Replace)
Returns
- TApizrOptionsBuilder
Type Parameters
THandler
WithHeaders(Func<IList<string>>, ApizrDuplicateStrategy, ApizrLifetimeScope, ApizrRegistrationMode)
Add some headers to the request
TApizrOptionsBuilder WithHeaders(Func<IList<string>> headersFactory, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add, ApizrLifetimeScope scope = ApizrLifetimeScope.Api, ApizrRegistrationMode mode = ApizrRegistrationMode.Set)
Parameters
headersFactory
Func<IList<string>>Headers factory
strategy
ApizrDuplicateStrategyThe duplicate strategy if there's another one already (default: Add)
scope
ApizrLifetimeScopeTells Apizr if you want to refresh or not headers values at request time (default: Api = no refresh)
mode
ApizrRegistrationModeSet headers right the way or store it for further attribute key match use (default: Set)
Returns
- TApizrOptionsBuilder
WithHeaders<TSettingsService>(Func<TSettingsService>, Expression<Func<TSettingsService, string>>[], ApizrDuplicateStrategy, ApizrLifetimeScope, ApizrRegistrationMode)
Add some headers to the request loaded from service properties
TApizrOptionsBuilder WithHeaders<TSettingsService>(Func<TSettingsService> settingsServiceFactory, Expression<Func<TSettingsService, string>>[] headerProperties, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add, ApizrLifetimeScope scope = ApizrLifetimeScope.Api, ApizrRegistrationMode mode = ApizrRegistrationMode.Set)
Parameters
settingsServiceFactory
Func<TSettingsService>A
TSettingsService
instance factoryheaderProperties
Expression<Func<TSettingsService, string>>[]The header properties to get from
strategy
ApizrDuplicateStrategyThe duplicate strategy if there's another one already (default: Add)
scope
ApizrLifetimeScopeTells Apizr if you want to refresh or not headers values at request time (default: Api = no refresh)
mode
ApizrRegistrationModeSet headers right the way or store it for further attribute key match use (default: Set)
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (getting headers)
WithHeaders<TSettingsService>(TSettingsService, Expression<Func<TSettingsService, string>>[], ApizrDuplicateStrategy, ApizrLifetimeScope, ApizrRegistrationMode)
Add some headers to the request loaded from service properties
TApizrOptionsBuilder WithHeaders<TSettingsService>(TSettingsService settingsService, Expression<Func<TSettingsService, string>>[] headerProperties, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add, ApizrLifetimeScope scope = ApizrLifetimeScope.Api, ApizrRegistrationMode mode = ApizrRegistrationMode.Set)
Parameters
settingsService
TSettingsServiceA
TSettingsService
instanceheaderProperties
Expression<Func<TSettingsService, string>>[]The header properties to get from
strategy
ApizrDuplicateStrategyThe duplicate strategy if there's another one already (default: Add)
scope
ApizrLifetimeScopeTells Apizr if you want to refresh or not headers values at request time (default: Api = no refresh)
mode
ApizrRegistrationModeSet headers right the way or store it for further attribute key match use (default: Set)
Returns
- TApizrOptionsBuilder
Type Parameters
TSettingsService
Your settings management service (getting headers)
WithHttpClientHandler(Func<HttpClientHandler>)
Provide a custom HttpClientHandler
TApizrOptionsBuilder WithHttpClientHandler(Func<HttpClientHandler> httpClientHandlerFactory)
Parameters
httpClientHandlerFactory
Func<HttpClientHandler>An HttpClientHandler instance factory
Returns
- TApizrOptionsBuilder
WithHttpMessageHandler<THandler>(Func<IApizrManagerOptionsBase, THandler>)
Add a custom http message handler inheriting from HttpMessageHandler (last call)
TApizrOptionsBuilder WithHttpMessageHandler<THandler>(Func<IApizrManagerOptionsBase, THandler> httpMessageHandlerFactory) where THandler : HttpMessageHandler
Parameters
httpMessageHandlerFactory
Func<IApizrManagerOptionsBase, THandler>A http message handler factory
Returns
- TApizrOptionsBuilder
Type Parameters
THandler
WithLogging(Func<HttpTracerMode>, Func<HttpMessageParts>, Func<LogLevel[]>)
Define tracer mode, http traffic tracing verbosity and log levels (could be defined with LogAttribute)
TApizrOptionsBuilder WithLogging(Func<HttpTracerMode> httpTracerModeFactory, Func<HttpMessageParts> trafficVerbosityFactory, Func<LogLevel[]> logLevelsFactory)
Parameters
httpTracerModeFactory
Func<HttpTracerMode>Http traffic tracing mode
trafficVerbosityFactory
Func<HttpMessageParts>Http traffic tracing verbosity factory
logLevelsFactory
Func<LogLevel[]>Log levels factory
Returns
- TApizrOptionsBuilder
WithLogging(Func<(HttpTracerMode, HttpMessageParts, LogLevel[])>)
Define tracer mode, http traffic tracing verbosity and log levels (could be defined with LogAttribute)
TApizrOptionsBuilder WithLogging(Func<(HttpTracerMode, HttpMessageParts, LogLevel[])> loggingConfigurationFactory)
Parameters
loggingConfigurationFactory
Func<(HttpTracerMode, HttpMessageParts, LogLevel[])>Logging configuration factory
Returns
- TApizrOptionsBuilder
WithOperationTimeout(Func<TimeSpan>)
Set a timeout to the operation (overall request tries)
TApizrOptionsBuilder WithOperationTimeout(Func<TimeSpan> timeoutFactory)
Parameters
Returns
- TApizrOptionsBuilder
WithRequestTimeout(Func<TimeSpan>)
Set a timeout to the request (each request try)
TApizrOptionsBuilder WithRequestTimeout(Func<TimeSpan> timeoutFactory)
Parameters
Returns
- TApizrOptionsBuilder
WithResilienceProperty<TValue>(ResiliencePropertyKey<TValue>, Func<TValue>)
Set some resilience properties to the resilience context
TApizrOptionsBuilder WithResilienceProperty<TValue>(ResiliencePropertyKey<TValue> key, Func<TValue> valueFactory)
Parameters
key
ResiliencePropertyKey<TValue>The resilience property's key
valueFactory
Func<TValue>The resilience property's value factory
Returns
- TApizrOptionsBuilder
Type Parameters
TValue