Fhi.HelseId.Refit
1.0.0-beta.3
See the version list below for details.
dotnet add package Fhi.HelseId.Refit --version 1.0.0-beta.3
NuGet\Install-Package Fhi.HelseId.Refit -Version 1.0.0-beta.3
<PackageReference Include="Fhi.HelseId.Refit" Version="1.0.0-beta.3" />
paket add Fhi.HelseId.Refit --version 1.0.0-beta.3
#r "nuget: Fhi.HelseId.Refit, 1.0.0-beta.3"
// Install Fhi.HelseId.Refit as a Cake Addin #addin nuget:?package=Fhi.HelseId.Refit&version=1.0.0-beta.3&prerelease // Install Fhi.HelseId.Refit as a Cake Tool #tool nuget:?package=Fhi.HelseId.Refit&version=1.0.0-beta.3&prerelease
Fhi.HelseId.Refit
This package contains code to simplify working with Refit and HelseId.
This default setup will add a token handler to your Refit Interface in addition to letting you add multiple delegates if needed (f.ex. logging).
Usage
Include thhis code in your WebApi startup builder:
builder.AddHelseidRefitBuilder()
.AddRefitClient<IMyRefitClient>();
If you want to add additional loggers add them before "AddRefitClient":
builder.AddHelseidRefitBuilder()
.AddHandler<MyLoggingDelegationHandler>()
.AddRefitClient<IMyRefitClient>();
The code loads your configuration from IConfiguration using the section "HelseIdWebKonfigurasjon". If you want to override which section to use you can pass the correct section to AddHelseidRefitBuilder:
builder.AddHelseidRefitBuilder("CustomHelseIdWebKonfigurasjon")
.AddRefitClient<IMyRefitClient>();
The default RefitSettings we are using use SystemTextJsonContentSerializer, is case insensitive and use camelCasing. If you want to override the default RefitSettings to use you can pass the settings to AddHelseidRefitBuilder:
builder.AddHelseidRefitBuilder(new RefitSettings())
.AddRefitClient<IMyRefitClient>();
Adding Correlation Id to all requests
Use "AddCorrelationId()" to add header propagation of the default FHI correlation id header.
builder.AddHelseidRefitBuilder()
.AddCorrelationId()
.AddRefitClient<IMyRefitClient>();
A new correlation ID will be given to each request and response that does not contain the header when invoked. Remember to add usage of header propagation to your app startup code:
app.UseHeaderPropagation();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Fhi.HelseId (>= 5.2.0)
- Microsoft.AspNetCore.Components (>= 6.0.0)
- Microsoft.AspNetCore.HeaderPropagation (>= 6.0.24)
- Refit (>= 6.3.2)
- Refit.HttpClientFactory (>= 6.3.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.0.1 | 153 | 11/29/2024 |
8.0.0 | 397 | 11/19/2024 |
7.1.2 | 166 | 11/6/2024 |
7.1.1 | 121 | 11/1/2024 |
7.1.0 | 81 | 10/31/2024 |
7.0.1 | 644 | 10/23/2024 |
7.0.0 | 84 | 10/21/2024 |
6.3.0 | 217 | 10/11/2024 |
6.2.1 | 189 | 10/7/2024 |
6.2.0 | 129 | 9/27/2024 |
6.2.0-beta.2 | 52 | 9/24/2024 |
6.2.0-beta.1 | 71 | 9/17/2024 |
6.1.0 | 113 | 9/10/2024 |
6.0.0 | 509 | 8/7/2024 |
1.1.2-alpha.1 | 65 | 5/6/2024 |
1.1.1 | 133 | 5/2/2024 |
1.1.0 | 91 | 5/2/2024 |
1.0.0-beta.6 | 372 | 2/14/2024 |
1.0.0-beta.5 | 341 | 2/13/2024 |
1.0.0-beta.3 | 112 | 1/7/2024 |
1.0.0-beta.2 | 73 | 1/4/2024 |
1.0.0-beta.1 | 311 | 11/24/2023 |
1.0.0-alpha.1 | 92 | 1/12/2024 |