Tor.Fixer.Client
1.0.0
dotnet add package Tor.Fixer.Client --version 1.0.0
NuGet\Install-Package Tor.Fixer.Client -Version 1.0.0
<PackageReference Include="Tor.Fixer.Client" Version="1.0.0" />
paket add Tor.Fixer.Client --version 1.0.0
#r "nuget: Tor.Fixer.Client, 1.0.0"
// Install Tor.Fixer.Client as a Cake Addin #addin nuget:?package=Tor.Fixer.Client&version=1.0.0 // Install Tor.Fixer.Client as a Cake Tool #tool nuget:?package=Tor.Fixer.Client&version=1.0.0
Tor.Currency.Fixer.Io.Client
A C# client library for Fixer.io API with dependency injection support.
Installation
Install-Package Tor.Fixer.Client
Usage
Registering to .NET Core service collection
You have to register the FixerClient with the dependencies in the Program.cs file.
For the minimal registration, you have to add your Fixer.io API key to the options builder:
builder.Services.AddFixer(options =>
{
options.WithApiKey("Your API key");
});
Options
Setting the API key:
builder.Services.AddFixer(options =>
{
options.WithApiKey("Your Fixer.io API key");
});
If you want to implement some API key factory logic, f.e.: if you want to change your API key in runtime:
public static class SharedData
{
public static string FixerApiKey { get; set; } = "Your Fixer.io API key";
}
builder.Services.AddFixer(options =>
{
options.WithApiKeyFactory(() => SharedData.FixerApiKey);
});
If you use an alias accessing Fixer.io or the Fixer.io base address changes and this package is not updated yet, you can override the base address:
builder.Services.AddFixer(options =>
{
options.WithBaseUrl("Your URL");
});
Based on your design, you can choose a http error handling mode with the following code:
builder.Services.AddFixer(options =>
{
options.WithHttpErrorHandling(HttpErrorHandlingMode.ReturnsError);
});
There are two options (default: ReturnsError):
- ReturnsError: when the http call ends with an errorcode, the error will be in the response, there will be no exceptions
- ThrowsException: when http call ends with an errorcode, there will be an exception
Of course, you can combine these options for your needs except WithApiKey and WithApiKeyFactory.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Http (>= 8.0.1)
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 |
---|---|---|
1.0.0 | 68 | 2/12/2025 |