Configuring DelegatingHandlers
You can add DelegatingHandlers thanks to this option:
// direct configuration
options => options.WithDelegatingHandler(YourDelegatingHandler)
// Or type configuration (has to be registered in the service collection)
options => options.WithDelegatingHandler<YourDelegatingHandler>()
// OR factory configuration with the service provider instance
options => options.WithDelegatingHandler(serviceProvider => YourDelegatingHandler)
// OR factory configuration with the service provider and options instances
options => options.WithDelegatingHandler((serviceProvider, options) => YourDelegatingHandler)
You may want to adjust duplicate strategy while registering a DelegatingHandler. You can do it by providing your own strategy thanks to the optional parameter (default: Add).
Warning
Inner DelegatingHandler
Do not try to manage delegating handlers hierarchy by yourself, providing any inner handlers. Instead, just add your handlers thanks to the WithDelegatingHandler option the order you want and Apizr will do it for you.