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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tor.Fixer.Client" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Tor.Fixer.Client --version 1.0.0                
#r "nuget: Tor.Fixer.Client, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

alternate text is missing from this package README image alternate text is missing from this package README image

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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