Provides access to the EXR Dataflow (currency exchange rates) of ECB Data Portal web services.
To add ECB.Data.ExchangeRates to your project, you can use the following NuGet Package Manager command:
Install-Package ECB.Data.ExchangeRates
More options are available on the ECB.Data.ExchangeRates page of the NuGet Gallery website.
The console application ECB.Data.ExchangeRates.ConsoleApp (ECBEXR.exe) is intended as an example on how to use the web services client 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();
}
}