Class ApizrExtendedProperOptionsBuilder
- Namespace
- Apizr.Extending.Configuring.Proper
- Assembly
- Apizr.Extensions.Microsoft.DependencyInjection.dll
Builder options available at proper level for extended registrations
public class ApizrExtendedProperOptionsBuilder : IApizrExtendedProperOptionsBuilder, IApizrExtendedProperOptionsBuilder<IApizrExtendedProperOptions, IApizrExtendedProperOptionsBuilder>, IApizrExtendedProperOptionsBuilderBase, IApizrGlobalProperOptionsBuilderBase<IApizrExtendedProperOptions, IApizrExtendedProperOptionsBuilder>, IApizrGlobalProperOptionsBuilderBase, IApizrExtendedSharedOptionsBuilder<IApizrExtendedProperOptions, IApizrExtendedProperOptionsBuilder>, IApizrExtendedSharedRegistrationOptionsBuilderBase, IApizrGlobalSharedRegistrationOptionsBuilderBase<IApizrExtendedProperOptions, IApizrExtendedProperOptionsBuilder>, IApizrGlobalSharedOptionsBuilderBase<IApizrExtendedProperOptions, IApizrExtendedProperOptionsBuilder>, IApizrGlobalSharedRegistrationOptionsBuilderBase, IApizrGlobalSharedOptionsBuilderBase- Inheritance
- 
      
      ApizrExtendedProperOptionsBuilder
- Implements
- 
      
      
      
      IApizrGlobalProperOptionsBuilderBase<IApizrExtendedProperOptions, IApizrExtendedProperOptionsBuilder>IApizrGlobalSharedRegistrationOptionsBuilderBase<IApizrExtendedProperOptions, IApizrExtendedProperOptionsBuilder>
- Inherited Members
Fields
Options
protected readonly ApizrExtendedProperOptions OptionsField Value
Methods
ConfigureHttpClientBuilder(Action<IHttpClientBuilder>, ApizrDuplicateStrategy)
Adjust some HttpClient settings
public IApizrExtendedProperOptionsBuilder ConfigureHttpClientBuilder(Action<IHttpClientBuilder> httpClientBuilder, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Merge)Parameters
- httpClientBuilderAction<IHttpClientBuilder>
- The HttpClient builder 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another one already (default: Merge) 
Returns
WithAuthenticationHandler(Func<HttpRequestMessage, string, CancellationToken, Task<string>>)
Provide a method to refresh the authorization token when needed
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler(Func<HttpRequestMessage, string, CancellationToken, Task<string>> refreshTokenFactory)Parameters
- refreshTokenFactoryFunc<HttpRequestMessage, string, CancellationToken, Task<string>>
- Refresh token method called when expired or empty 
Returns
WithAuthenticationHandler(Func<HttpRequestMessage, CancellationToken, Task<string>>)
Provide methods to only get the authorization constant token when needed
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler(Func<HttpRequestMessage, CancellationToken, Task<string>> getTokenFactory)Parameters
- getTokenFactoryFunc<HttpRequestMessage, CancellationToken, Task<string>>
- The method called to get local constant token 
Returns
WithAuthenticationHandler(Func<HttpRequestMessage, CancellationToken, Task<string>>, Func<HttpRequestMessage, string, CancellationToken, Task>)
Provide methods to get and set the authorization token when needed
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler(Func<HttpRequestMessage, CancellationToken, Task<string>> getTokenFactory, Func<HttpRequestMessage, string, CancellationToken, Task> setTokenFactory)Parameters
- getTokenFactoryFunc<HttpRequestMessage, CancellationToken, Task<string>>
- The method called to get local token 
- setTokenFactoryFunc<HttpRequestMessage, string, CancellationToken, Task>
- The method called to set local token 
Returns
WithAuthenticationHandler(Func<HttpRequestMessage, CancellationToken, Task<string>>, Func<HttpRequestMessage, string, CancellationToken, Task>, Func<HttpRequestMessage, string, CancellationToken, Task<string>>)
Provide methods to get, set and refresh the authorization token when needed
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler(Func<HttpRequestMessage, CancellationToken, Task<string>> getTokenFactory, Func<HttpRequestMessage, string, CancellationToken, Task> setTokenFactory, Func<HttpRequestMessage, string, CancellationToken, Task<string>> refreshTokenFactory)Parameters
- getTokenFactoryFunc<HttpRequestMessage, CancellationToken, Task<string>>
- The method called to get local token 
- setTokenFactoryFunc<HttpRequestMessage, string, CancellationToken, Task>
- The method called to get local token 
- refreshTokenFactoryFunc<HttpRequestMessage, string, CancellationToken, Task<string>>
- Refresh token method called when expired or empty 
Returns
WithAuthenticationHandler(Type)
Provide your own AuthenticationHandlerBase generic implementation
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler(Type authenticationHandlerType)Parameters
- authenticationHandlerTypeType
- Your own AuthenticationHandlerBase generic implementation 
Returns
WithAuthenticationHandler<TAuthenticationHandler>(Func<IServiceProvider, IApizrManagerOptionsBase, TAuthenticationHandler>)
Provide your own AuthenticationHandlerBase implementation
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler<TAuthenticationHandler>(Func<IServiceProvider, IApizrManagerOptionsBase, TAuthenticationHandler> authenticationHandlerFactory) where TAuthenticationHandler : AuthenticationHandlerBaseParameters
- authenticationHandlerFactoryFunc<IServiceProvider, IApizrManagerOptionsBase, TAuthenticationHandler>
- A - TAuthenticationHandlerinstance factory
Returns
Type Parameters
- TAuthenticationHandler
- Your AuthenticationHandlerBase implementation 
WithAuthenticationHandler<TTokenService>(Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own token management services
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler<TTokenService>(Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenExpression)Parameters
- refreshTokenExpressionExpression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>
- The method called to refresh the token 
Returns
Type Parameters
- TTokenService
- Your token management service (refreshing token) 
WithAuthenticationHandler<TSettingsService>(Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>)
Provide your own settings management service
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler<TSettingsService>(Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>> getTokenExpression)Parameters
- getTokenExpressionExpression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>
- The get only token expression 
Returns
Type Parameters
- TSettingsService
- Your settings management service (getting constant token) 
WithAuthenticationHandler<TSettingsService>(Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>)
Provide your own settings management service
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler<TSettingsService>(Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>> getTokenExpression, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>> setTokenExpression)Parameters
- getTokenExpressionExpression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>
- The get token expression 
- setTokenExpressionExpression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>
- The set token expression 
Returns
Type Parameters
- TSettingsService
- Your settings management service (saving/getting token) 
WithAuthenticationHandler<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
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler<TAuthService>(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
- getTokenExpressionExpression<Func<TAuthService, HttpRequestMessage, CancellationToken, Task<string>>>
- The get token expression 
- setTokenExpressionExpression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task>>
- The set token expression 
- refreshTokenExpressionExpression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>>
- The method called to refresh the token 
Returns
Type Parameters
- TAuthService
- Your auth management service (saving/getting/refreshing token) 
WithAuthenticationHandler<TSettingsService>(Expression<Func<TSettingsService, string>>)
Provide your own settings management service with its token source
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler<TSettingsService>(Expression<Func<TSettingsService, string>> tokenPropertyExpression)Parameters
- tokenPropertyExpressionExpression<Func<TSettingsService, string>>
- The token property to get from and set to 
Returns
Type Parameters
- TSettingsService
- Your settings management service (getting token) 
WithAuthenticationHandler<TAuthService>(Expression<Func<TAuthService, string>>, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own auth management service
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler<TAuthService>(Expression<Func<TAuthService, string>> tokenPropertyExpression, Expression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenExpression)Parameters
- tokenPropertyExpressionExpression<Func<TAuthService, string>>
- The token property to get from and set to 
- refreshTokenExpressionExpression<Func<TAuthService, HttpRequestMessage, string, CancellationToken, Task<string>>>
Returns
Type Parameters
- TAuthService
- Your auth management service (saving/getting/refreshing token) 
WithAuthenticationHandler<TSettingsService, TTokenService>(Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own settings management and token management services
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler<TSettingsService, TTokenService>(Expression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>> getTokenExpression, Expression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>> setTokenExpression, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenExpression)Parameters
- getTokenExpressionExpression<Func<TSettingsService, HttpRequestMessage, CancellationToken, Task<string>>>
- The get token expression 
- setTokenExpressionExpression<Func<TSettingsService, HttpRequestMessage, string, CancellationToken, Task>>
- The set token expression 
- refreshTokenExpressionExpression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>
- The method called to refresh the token 
Returns
Type Parameters
- TSettingsService
- Your settings management service (saving/getting token) 
- TTokenService
- Your token management service (refreshing token) 
WithAuthenticationHandler<TSettingsService, TTokenService>(Expression<Func<TSettingsService, string>>, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>)
Provide your own settings management and token management services
public IApizrExtendedProperOptionsBuilder WithAuthenticationHandler<TSettingsService, TTokenService>(Expression<Func<TSettingsService, string>> tokenPropertyExpression, Expression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>> refreshTokenExpression)Parameters
- tokenPropertyExpressionExpression<Func<TSettingsService, string>>
- The token property to get from and set to 
- refreshTokenExpressionExpression<Func<TTokenService, HttpRequestMessage, string, CancellationToken, Task<string>>>
Returns
Type Parameters
- TSettingsService
- Your settings management service (saving/getting token) 
- TTokenService
- Your token management service (refreshing token) 
WithBaseAddress(Func<IServiceProvider, string>, ApizrDuplicateStrategy)
Define your web api base address (could be defined with WebApiAttribute)
public IApizrExtendedProperOptionsBuilder WithBaseAddress(Func<IServiceProvider, string> baseAddressFactory, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- baseAddressFactoryFunc<IServiceProvider, string>
- Your web api base address factory 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Replace) 
Returns
WithBaseAddress(Func<IServiceProvider, Uri>, ApizrDuplicateStrategy)
Define your web api base address (could be defined with WebApiAttribute)
public IApizrExtendedProperOptionsBuilder WithBaseAddress(Func<IServiceProvider, Uri> baseAddressFactory, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- baseAddressFactoryFunc<IServiceProvider, Uri>
- Your web api base address factory 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Replace) 
Returns
WithBaseAddress(string, ApizrDuplicateStrategy)
Define your web api base address (could be defined with WebApiAttribute)
public IApizrExtendedProperOptionsBuilder WithBaseAddress(string baseAddress, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- baseAddressstring
- Your web api base address 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Replace) 
Returns
WithBaseAddress(Uri, ApizrDuplicateStrategy)
Define your web api base address (could be defined with WebApiAttribute)
public IApizrExtendedProperOptionsBuilder WithBaseAddress(Uri baseAddress, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- baseAddressUri
- Your web api base address 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Replace) 
Returns
WithBasePath(Func<IServiceProvider, string>, ApizrDuplicateStrategy)
Define your web api base path (could be defined with WebApiAttribute)
public IApizrExtendedProperOptionsBuilder WithBasePath(Func<IServiceProvider, string> basePathFactory, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- basePathFactoryFunc<IServiceProvider, string>
- Your web api base path factory 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Replace) 
Returns
WithBasePath(string, ApizrDuplicateStrategy)
Define your web api base path (could be defined with WebApiAttribute)
public IApizrExtendedProperOptionsBuilder WithBasePath(string basePath, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- basePathstring
- Your web api base path 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Replace) 
Returns
WithCaching(CacheMode, TimeSpan?, bool)
Cache data.
public IApizrExtendedProperOptionsBuilder WithCaching(CacheMode mode = CacheMode.FetchOrGet, TimeSpan? lifeSpan = null, bool shouldInvalidateOnError = false)Parameters
- modeCacheMode
- FetchOrGet returns fresh data when request succeed otherwise cached one, where GetOrFetch returns cached data if we get some otherwise fresh one 
- lifeSpanTimeSpan?
- This specific caching lifetime (Default: null = cache handler lifetime 
- shouldInvalidateOnErrorbool
- Should invalidate on error (Default: false) 
Returns
WithConfiguration(IConfiguration)
Set options from configuration
public IApizrExtendedProperOptionsBuilder WithConfiguration(IConfiguration configuration)Parameters
- configurationIConfiguration
- The configuration to set options from 
Returns
WithConfiguration(IConfigurationSection)
Set options from a specific configuration section
public IApizrExtendedProperOptionsBuilder WithConfiguration(IConfigurationSection configurationSection)Parameters
- configurationSectionIConfigurationSection
- The configuration section to set options from 
Returns
WithDelegatingHandler<THandler>(ApizrDuplicateStrategy)
Add a custom delegating handler inheriting from DelegatingHandler (serial call)
public IApizrExtendedProperOptionsBuilder WithDelegatingHandler<THandler>(ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add) where THandler : DelegatingHandlerParameters
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Add) 
Returns
Type Parameters
- THandler
WithDelegatingHandler<THandler>(Func<IServiceProvider, IApizrManagerOptionsBase, THandler>, ApizrDuplicateStrategy)
Add a custom delegating handler inheriting from DelegatingHandler (serial call)
public IApizrExtendedProperOptionsBuilder WithDelegatingHandler<THandler>(Func<IServiceProvider, IApizrManagerOptionsBase, THandler> delegatingHandlerFactory, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add) where THandler : DelegatingHandlerParameters
- delegatingHandlerFactoryFunc<IServiceProvider, IApizrManagerOptionsBase, THandler>
- A delegating handler factory 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Add) 
Returns
Type Parameters
- THandler
WithDelegatingHandler<THandler>(Func<IServiceProvider, THandler>, ApizrDuplicateStrategy)
Add a custom delegating handler inheriting from DelegatingHandler (serial call)
public IApizrExtendedProperOptionsBuilder WithDelegatingHandler<THandler>(Func<IServiceProvider, THandler> delegatingHandlerFactory, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add) where THandler : DelegatingHandlerParameters
- delegatingHandlerFactoryFunc<IServiceProvider, THandler>
- A delegating handler factory 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Add) 
Returns
Type Parameters
- THandler
WithDelegatingHandler<THandler>(THandler, ApizrDuplicateStrategy)
Add a custom delegating handler inheriting from DelegatingHandler (serial call)
public IApizrExtendedProperOptionsBuilder WithDelegatingHandler<THandler>(THandler delegatingHandler, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add) where THandler : DelegatingHandlerParameters
- delegatingHandlerTHandler
- A delegating handler 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Add) 
Returns
Type Parameters
- THandler
WithExCatching(Action<ApizrException>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
[Obsolete("Catching an exception by an Action is now replaced by a Func returning a handled boolean flag")]
public IApizrExtendedProperOptionsBuilder WithExCatching(Action<ApizrException> onException, bool letThrowOnException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- onExceptionAction<ApizrException>
- The exception callback 
- letThrowOnExceptionbool
- Let throw potential exception (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
WithExCatching(Func<ApizrException, bool>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
public IApizrExtendedProperOptionsBuilder WithExCatching(Func<ApizrException, bool> onException, bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- onExceptionFunc<ApizrException, bool>
- The exception callback returning handled boolean flag 
- letThrowOnHandledExceptionbool
- Let throw potential exception even if it's handled (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
WithExCatching(Func<ApizrException, Task<bool>>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
public IApizrExtendedProperOptionsBuilder WithExCatching(Func<ApizrException, Task<bool>> onException, bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- onExceptionFunc<ApizrException, Task<bool>>
- The exception callback returning handled boolean flag Task 
- letThrowOnHandledExceptionbool
- Let throw potential exception even if it's handled (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
WithExCatching(Func<IServiceProvider, ApizrException, bool>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
public IApizrExtendedProperOptionsBuilder WithExCatching(Func<IServiceProvider, ApizrException, bool> onException, bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- onExceptionFunc<IServiceProvider, ApizrException, bool>
- The exception callback returning handled boolean flag 
- letThrowOnHandledExceptionbool
- Let throw potential exception even if it's handled (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
WithExCatching(Func<IServiceProvider, ApizrException, Task<bool>>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
public IApizrExtendedProperOptionsBuilder WithExCatching(Func<IServiceProvider, ApizrException, Task<bool>> onException, bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- onExceptionFunc<IServiceProvider, ApizrException, Task<bool>>
- The exception callback returning a handled boolean flag Task 
- letThrowOnHandledExceptionbool
- Let throw potential exception even if it's handled (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
WithExCatching<TResult>(Action<ApizrException<TResult>>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
[Obsolete("Catching an exception by an Action is now replaced by a Func returning a handled boolean flag")]
public IApizrExtendedProperOptionsBuilder WithExCatching<TResult>(Action<ApizrException<TResult>> onException, bool letThrowOnException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- onExceptionAction<ApizrException<TResult>>
- The exception callback 
- letThrowOnExceptionbool
- Let throw potential exception (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
Type Parameters
- TResult
WithExCatching<THandler>(bool, ApizrDuplicateStrategy)
Catch potential exceptions
public IApizrExtendedProperOptionsBuilder WithExCatching<THandler>(bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace) where THandler : IApizrExceptionHandlerParameters
- letThrowOnHandledExceptionbool
- Let throw potential exception even if it's handled (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
Type Parameters
- THandler
WithExCatching<TResult>(Func<ApizrException<TResult>, bool>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
public IApizrExtendedProperOptionsBuilder WithExCatching<TResult>(Func<ApizrException<TResult>, bool> onException, bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- onExceptionFunc<ApizrException<TResult>, bool>
- The exception callback returning handled boolean flag 
- letThrowOnHandledExceptionbool
- Let throw potential exception even if it's handled (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
Type Parameters
- TResult
WithExCatching<TResult>(Func<ApizrException<TResult>, Task<bool>>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
public IApizrExtendedProperOptionsBuilder WithExCatching<TResult>(Func<ApizrException<TResult>, Task<bool>> onException, bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- onExceptionFunc<ApizrException<TResult>, Task<bool>>
- The exception callback returning a handled boolean flag Task 
- letThrowOnHandledExceptionbool
- Let throw potential exception even if it's handled (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
Type Parameters
- TResult
WithExCatching<TResult>(Func<IServiceProvider, ApizrException<TResult>, bool>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
public IApizrExtendedProperOptionsBuilder WithExCatching<TResult>(Func<IServiceProvider, ApizrException<TResult>, bool> onException, bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- onExceptionFunc<IServiceProvider, ApizrException<TResult>, bool>
- The exception callback returning handled boolean flag 
- letThrowOnHandledExceptionbool
- Let throw potential exception even if it's handled (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
Type Parameters
- TResult
WithExCatching<TResult>(Func<IServiceProvider, ApizrException<TResult>, Task<bool>>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
public IApizrExtendedProperOptionsBuilder WithExCatching<TResult>(Func<IServiceProvider, ApizrException<TResult>, Task<bool>> onException, bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace)Parameters
- onExceptionFunc<IServiceProvider, ApizrException<TResult>, Task<bool>>
- The exception callback returning a handled boolean flag Task 
- letThrowOnHandledExceptionbool
- Let throw potential exception even if it's handled (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
Type Parameters
- TResult
WithExCatching<THandler>(Func<IServiceProvider, THandler>, bool, ApizrDuplicateStrategy)
Catch potential exceptions
public IApizrExtendedProperOptionsBuilder WithExCatching<THandler>(Func<IServiceProvider, THandler> exceptionHandlerFactory, bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace) where THandler : IApizrExceptionHandlerParameters
- exceptionHandlerFactoryFunc<IServiceProvider, THandler>
- The exception handler called back and returning handled boolean flag Task 
- letThrowOnHandledExceptionbool
- Let throw potential exception even if it's handled (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
Type Parameters
- THandler
WithExCatching<THandler>(THandler, bool, ApizrDuplicateStrategy)
Catch potential exceptions
public IApizrExtendedProperOptionsBuilder WithExCatching<THandler>(THandler exceptionHandler, bool letThrowOnHandledException = true, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Replace) where THandler : IApizrExceptionHandlerParameters
- exceptionHandlerTHandler
- The exception handler called back and returning handled boolean flag Task 
- letThrowOnHandledExceptionbool
- Let throw potential exception even if it's handled (default: true) 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another callback already (default: Replace) 
Returns
Type Parameters
- THandler
WithHandlerParameter(string, object)
Set some parameters passed through all delegating handlers
public IApizrExtendedProperOptionsBuilder WithHandlerParameter(string key, object value)Parameters
Returns
WithHeaders(IList<string>, ApizrDuplicateStrategy, ApizrRegistrationMode)
Add some headers to the request
public IApizrExtendedProperOptionsBuilder WithHeaders(IList<string> headers, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add, ApizrRegistrationMode behavior = ApizrRegistrationMode.Set)Parameters
- headersIList<string>
- Headers to add to the request 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Add) 
- behaviorApizrRegistrationMode
Returns
WithHeaders(Func<IServiceProvider, IList<string>>, ApizrDuplicateStrategy, ApizrLifetimeScope, ApizrRegistrationMode)
Add some headers to the request
public IApizrExtendedProperOptionsBuilder WithHeaders(Func<IServiceProvider, IList<string>> headersFactory, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add, ApizrLifetimeScope scope = ApizrLifetimeScope.Api, ApizrRegistrationMode mode = ApizrRegistrationMode.Set)Parameters
- headersFactoryFunc<IServiceProvider, IList<string>>
- Headers to add to the request 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another one already (default: Add) 
- scopeApizrLifetimeScope
- Tells Apizr if you want to refresh or not headers values at request time (default: Api = no refresh) 
- modeApizrRegistrationMode
- Set headers right the way or store it for further attribute key match use (default: Set) 
Returns
WithHeaders<TSettingsService>(Expression<Func<TSettingsService, string>>[], ApizrDuplicateStrategy, ApizrLifetimeScope, ApizrRegistrationMode)
Add some headers to the request loaded from service properties
public IApizrExtendedProperOptionsBuilder WithHeaders<TSettingsService>(Expression<Func<TSettingsService, string>>[] headerProperties, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add, ApizrLifetimeScope scope = ApizrLifetimeScope.Api, ApizrRegistrationMode mode = ApizrRegistrationMode.Set)Parameters
- headerPropertiesExpression<Func<TSettingsService, string>>[]
- The header properties to get from 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's another one already (default: Add) 
- scopeApizrLifetimeScope
- Tells Apizr if you want to refresh or not headers values at request time (default: Api = no refresh) 
- modeApizrRegistrationMode
- Set headers right the way or store it for further attribute key match use (default: Set) 
Returns
Type Parameters
- TSettingsService
- Your settings management service (getting headers) 
WithHttpClientHandler(Func<IServiceProvider, HttpClientHandler>)
Provide a custom HttpClientHandler
public IApizrExtendedProperOptionsBuilder WithHttpClientHandler(Func<IServiceProvider, HttpClientHandler> httpClientHandlerFactory)Parameters
- httpClientHandlerFactoryFunc<IServiceProvider, HttpClientHandler>
- An HttpClientHandler instance factory 
Returns
WithHttpClientHandler(HttpClientHandler)
Provide a custom HttpClientHandler
public IApizrExtendedProperOptionsBuilder WithHttpClientHandler(HttpClientHandler httpClientHandler)Parameters
- httpClientHandlerHttpClientHandler
- An HttpClientHandler instance 
Returns
WithHttpMessageHandler<THandler>()
Add a custom http message handler inheriting from HttpMessageHandler (last call)
public IApizrExtendedProperOptionsBuilder WithHttpMessageHandler<THandler>() where THandler : HttpMessageHandlerReturns
Type Parameters
- THandler
WithHttpMessageHandler<THandler>(Func<IServiceProvider, IApizrManagerOptionsBase, THandler>)
Add a custom http message handler inheriting from HttpMessageHandler (last call)
public IApizrExtendedProperOptionsBuilder WithHttpMessageHandler<THandler>(Func<IServiceProvider, IApizrManagerOptionsBase, THandler> httpMessageHandlerFactory) where THandler : HttpMessageHandlerParameters
- httpMessageHandlerFactoryFunc<IServiceProvider, IApizrManagerOptionsBase, THandler>
- A http message handler factory 
Returns
Type Parameters
- THandler
WithHttpMessageHandler<THandler>(Func<IServiceProvider, THandler>)
Add a custom http message handler inheriting from HttpMessageHandler (last call)
public IApizrExtendedProperOptionsBuilder WithHttpMessageHandler<THandler>(Func<IServiceProvider, THandler> httpMessageHandlerFactory) where THandler : HttpMessageHandlerParameters
- httpMessageHandlerFactoryFunc<IServiceProvider, THandler>
- A http message handler factory 
Returns
Type Parameters
- THandler
WithHttpMessageHandler<THandler>(THandler)
Add a custom http message handler inheriting from HttpMessageHandler (last call)
public IApizrExtendedProperOptionsBuilder WithHttpMessageHandler<THandler>(THandler httpMessageHandler) where THandler : HttpMessageHandlerParameters
- httpMessageHandlerTHandler
- A http message handler 
Returns
Type Parameters
- THandler
WithLoggedHeadersRedactionNames(IEnumerable<string>, ApizrDuplicateStrategy)
Sets the collection of HTTP headers names for which values should be redacted before logging.
public IApizrExtendedProperOptionsBuilder WithLoggedHeadersRedactionNames(IEnumerable<string> redactedLoggedHeaderNames, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add)Parameters
- redactedLoggedHeaderNamesIEnumerable<string>
- The collection of HTTP headers names for which values should be redacted before logging. 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other names already (default: Add) 
Returns
WithLoggedHeadersRedactionRule(Func<string, bool>, ApizrDuplicateStrategy)
Sets the Func<T, TResult> which determines whether to redact the HTTP header value before logging.
public IApizrExtendedProperOptionsBuilder WithLoggedHeadersRedactionRule(Func<string, bool> shouldRedactHeaderValue, ApizrDuplicateStrategy strategy = ApizrDuplicateStrategy.Add)Parameters
- shouldRedactHeaderValueFunc<string, bool>
- The Func<T, TResult> which determines whether to redact the HTTP header value before logging 
- strategyApizrDuplicateStrategy
- The duplicate strategy if there's any other names already (default: Add) 
Returns
WithLogging(HttpTracerMode, HttpMessageParts, params LogLevel[])
Define tracer mode, http traffic tracing verbosity and log levels (could be defined with LogAttribute)
public IApizrExtendedProperOptionsBuilder WithLogging(HttpTracerMode httpTracerMode = HttpTracerMode.Everything, HttpMessageParts trafficVerbosity = HttpMessageParts.All, params LogLevel[] logLevels)Parameters
- httpTracerModeHttpTracerMode
- trafficVerbosityHttpMessageParts
- Http traffic tracing verbosity (default: All) 
- logLevelsLogLevel[]
- Log levels to apply while writing (default: Information) 
Returns
WithLogging(Func<IServiceProvider, HttpTracerMode>, Func<IServiceProvider, HttpMessageParts>, Func<IServiceProvider, LogLevel[]>)
Define tracer mode, http traffic tracing verbosity and log levels (could be defined with LogAttribute)
public IApizrExtendedProperOptionsBuilder WithLogging(Func<IServiceProvider, HttpTracerMode> httpTracerModeFactory, Func<IServiceProvider, HttpMessageParts> trafficVerbosityFactory, Func<IServiceProvider, LogLevel[]> logLevelsFactory)Parameters
- httpTracerModeFactoryFunc<IServiceProvider, HttpTracerMode>
- Http traffic tracing mode factory 
- trafficVerbosityFactoryFunc<IServiceProvider, HttpMessageParts>
- Http traffic tracing verbosity factory 
- logLevelsFactoryFunc<IServiceProvider, LogLevel[]>
- Log levels factory 
Returns
WithLogging(Func<IServiceProvider, (HttpTracerMode, HttpMessageParts, LogLevel[])>)
Define tracer mode, http traffic tracing verbosity and log levels (could be defined with LogAttribute)
public IApizrExtendedProperOptionsBuilder WithLogging(Func<IServiceProvider, (HttpTracerMode, HttpMessageParts, LogLevel[])> loggingConfigurationFactory)Parameters
- loggingConfigurationFactoryFunc<IServiceProvider, (HttpTracerMode, HttpMessageParts, LogLevel[])>
- Logging configuration factory 
Returns
WithOperationTimeout(Func<IServiceProvider, TimeSpan>)
Set a timeout to the operation (overall request tries)
public IApizrExtendedProperOptionsBuilder WithOperationTimeout(Func<IServiceProvider, TimeSpan> timeoutFactory)Parameters
- timeoutFactoryFunc<IServiceProvider, TimeSpan>
- The operation timeout factory 
Returns
WithOperationTimeout(TimeSpan)
Set a timeout to the operation (overall request tries)
public IApizrExtendedProperOptionsBuilder WithOperationTimeout(TimeSpan timeout)Parameters
- timeoutTimeSpan
- The operation timeout 
Returns
WithRequestOptions(string, Action<IApizrRequestOptionsBuilder>, ApizrDuplicateStrategy)
Configure options for specific requests
public IApizrExtendedProperOptionsBuilder WithRequestOptions(string requestName, Action<IApizrRequestOptionsBuilder> optionsBuilder, ApizrDuplicateStrategy duplicateStrategy = ApizrDuplicateStrategy.Add)Parameters
- requestNamestring
- The name of the request to configure 
- optionsBuilderAction<IApizrRequestOptionsBuilder>
- The configuration builder 
- duplicateStrategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Add) 
Returns
WithRequestOptions(string[], Action<IApizrRequestOptionsBuilder>, ApizrDuplicateStrategy)
Configure options for specific requests
public IApizrExtendedProperOptionsBuilder WithRequestOptions(string[] requestNames, Action<IApizrRequestOptionsBuilder> optionsBuilder, ApizrDuplicateStrategy duplicateStrategy = ApizrDuplicateStrategy.Add)Parameters
- requestNamesstring[]
- The name of the requests to configure 
- optionsBuilderAction<IApizrRequestOptionsBuilder>
- The configuration builder 
- duplicateStrategyApizrDuplicateStrategy
- The duplicate strategy if there's any other already (default: Add) 
Returns
WithRequestTimeout(Func<IServiceProvider, TimeSpan>)
Set a timeout to the request (each request try)
public IApizrExtendedProperOptionsBuilder WithRequestTimeout(Func<IServiceProvider, TimeSpan> timeoutFactory)Parameters
- timeoutFactoryFunc<IServiceProvider, TimeSpan>
- The request timeout factory 
Returns
WithRequestTimeout(TimeSpan)
Set a timeout to the request (each request try)
public IApizrExtendedProperOptionsBuilder WithRequestTimeout(TimeSpan timeout)Parameters
- timeoutTimeSpan
- The request timeout 
Returns
WithResilienceContextOptions(Action<IApizrResilienceContextOptionsBuilder>)
Set some options to the resilience context
public IApizrExtendedProperOptionsBuilder WithResilienceContextOptions(Action<IApizrResilienceContextOptionsBuilder> contextOptionsBuilder)Parameters
- contextOptionsBuilderAction<IApizrResilienceContextOptionsBuilder>
- The resilience context options builder 
Returns
WithResiliencePipelineKeys(string[], IEnumerable<ApizrRequestMethod>, ApizrDuplicateStrategy)
Apply some resilience strategies by getting pipelines from registry with key matching.
public IApizrExtendedProperOptionsBuilder WithResiliencePipelineKeys(string[] resiliencePipelineKeys, IEnumerable<ApizrRequestMethod> methodScope = null, ApizrDuplicateStrategy duplicateStrategy = ApizrDuplicateStrategy.Add)Parameters
- resiliencePipelineKeysstring[]
- Resilience pipeline keys from the registry. 
- methodScopeIEnumerable<ApizrRequestMethod>
- Http or Crud methods to apply pipelines on (default: null = All) 
- duplicateStrategyApizrDuplicateStrategy
- The duplicate strategy if there's any other names already (default: Add) 
Returns
WithResilienceProperty<TValue>(ResiliencePropertyKey<TValue>, Func<IServiceProvider, TValue>)
Set some resilience properties to the resilience context
public IApizrExtendedProperOptionsBuilder WithResilienceProperty<TValue>(ResiliencePropertyKey<TValue> key, Func<IServiceProvider, TValue> valueFactory)Parameters
- keyResiliencePropertyKey<TValue>
- The resilience property's key 
- valueFactoryFunc<IServiceProvider, TValue>
- The resilience property's value factory 
Returns
Type Parameters
- TValue
WithResilienceProperty<TValue>(ResiliencePropertyKey<TValue>, TValue)
Set some resilience properties to the resilience context
public IApizrExtendedProperOptionsBuilder WithResilienceProperty<TValue>(ResiliencePropertyKey<TValue> key, TValue value)Parameters
- keyResiliencePropertyKey<TValue>
- The resilience property's key 
- valueTValue
- The resilience property's value 
Returns
Type Parameters
- TValue