A .NET wrapper for the REST API of the currency exchange rates of Banca d'Italia (the central bank of Italy).
To add BIExchangeRates.Client to your project, you can use the following NuGet Package Manager command:
Install-Package BIExchangeRates.Client
More options are available on the BIExchangeRates.Client page of the NuGet Gallery website.
The console application BIExchangeRates.Console is intended as an example on how to use the REST API wrapper in a real scenario.
The class ExchangeRatesClient is derived from HttpClient that is intended to be instantiated once and re-used throughout the life of an application. Instantiating an ExchangeRatesClient class for every request will exhaust the number of sockets available under heavy loads. This will result in SocketException errors. Below is an example using ExchangeRatesClient correctly.
public class GoodController : ApiController
{
private static readonly ExchangeRatesClient ExchangeRatesClient;
static GoodController()
{
ExchangeRatesClient = new ExchangeRatesClient();
}
}