Table of Contents

Class DependencyInjectionSettings

Namespace
Refitter.Core
Assembly
Refitter.Core.dll

Dependency Injection settings describing how the Refit client should be configured. This can be used to configure the HttpClient pipeline with additional handlers

public class DependencyInjectionSettings
Inheritance
DependencyInjectionSettings
Inherited Members

Fields

DefaultExtensionMethodName

public const string DefaultExtensionMethodName = "ConfigureRefitClients"

Field Value

string

Properties

BaseUrl

Base Address for the HttpClient

public string? BaseUrl { get; set; }

Property Value

string

ExtensionMethodName

Name of IServiceCollection Extension Method. Default is ConfigureRefitClients, or ConfigureApizrManagers if ApizrSettings property is set

public string ExtensionMethodName { get; set; }

Property Value

string

FirstBackoffRetryInSeconds

The median delay to target before the first retry in seconds. Default is 1 second

public double FirstBackoffRetryInSeconds { get; set; }

Property Value

double

HttpMessageHandlers

A collection of HttpMessageHandlers to be added to the HttpClient pipeline. This can be for telemetry logging, authorization, etc.

public string[] HttpMessageHandlers { get; set; }

Property Value

string[]

MaxRetryCount

Default max retry count for transient error handling. Default is 6.

public int MaxRetryCount { get; set; }

Property Value

int

PollyMaxRetryCount

Default max retry count for transient error handling. Default is 6. This is deprecated. Use MaxRetryCount instead.

[Obsolete("Use MaxRetryCount instead")]
public int PollyMaxRetryCount { get; set; }

Property Value

int

TransientErrorHandler

Library to use for transient error handling Options:

  • None
  • Polly - Polly Framework and HTTP Extensions
  • HttpResilience - Microsoft HTTP Resilience Library
[JsonConverter(typeof(JsonStringEnumConverter))]
public TransientErrorHandler TransientErrorHandler { get; set; }

Property Value

TransientErrorHandler

UsePolly

Set this to true to use Polly for transient fault handling. This is deprecated. Use TransientErrorHandler instead.

[Obsolete("Use TransientErrorHandler instead")]
public bool UsePolly { get; set; }

Property Value

bool