.NET Framework

.NET Framework

Framework for integrating Exchange Rates

The repository contains the SDK for simplifying TBC Open API Exchange Rate API invocations on C# client application side.
​The library is written in the C# programming language and is compatible with .netstandard2.0 and .net6.0.​


In order to use the SDK, it is mandatory to have apikey from TBC Bank's OpenAPI Developer portal.
​See more details on how to get ​apikey.

.Net Core Usage

​First step is to configure appsettings.json file with Exchange rate endpoint and TBC Portal apikey

"ExchangeRates": {
"BaseUrl": "https://tbcbank-test.apigee.net/v1/exchange-rates/",
"ApiKey": "{apikey}"

Then add Exchange rate client as an dependency injection


​After two steps above, setup is done and Exchange rate client can be injected in any container class:​Injection example:​

private readonly IExchangeRatesClient _exchangeRatesClient;
public TestController(IExchangeRatesClient exchangeRatesClient)
_exchangeRatesClient = exchangeRatesClient;

​Api invocation example:​

var result = await _exchangeRatesClient.GetOfficialRates(
new string[] { "EUR", "USD"},

NetFramework Usage

​First step is to configure Web.config file with Exchange rate endpoint and TBC Portal apikey

<add key="ExchangeRatesUrl" value="https://tbcbank-test.apigee.net/v1/exchange-rates/" />
<add key="ExchangeRatesKey" value="{apikey}" />

​In the Global.asax file at Application_Start() add following code

new OpenApiClientFactoryBuilder()
.AddExchangeRatesClient(new ExchangeRatesClientOptions
BaseUrl = ConfigurationManager.AppSettings["ExchangeRatesUrl"],
ApiKey = ConfigurationManager.AppSettings["ExchangeRatesKey"]

​This code reads config parameters and then creates singleton OpenApiClientFactory, which is used to instantiate Exchange rate client.
​ExchangeRatesClient class instantiation and invocation example:​

var exchangeRatesClient = OpenApiClientFactory.Instance.GetExchangeRatesClient();
var result = await exchangeRatesClient.GetOfficialRates(new string[] { "EUR", "USD"});

​For more details see examples in repo:​​

Did this page help you?