Interface ICurrencyConverter
- Namespace
- Ecng.Net.Currencies
- Assembly
- Ecng.Net.Clients.dll
Provides methods to convert one currency to another.
public interface ICurrencyConverter
- Extension Methods
Methods
GetRateAsync(CurrencyTypes, CurrencyTypes, DateTime, CancellationToken)
Retrieves the conversion rate from one currency to another for a specified date.
Task<decimal> GetRateAsync(CurrencyTypes from, CurrencyTypes to, DateTime date, CancellationToken cancellationToken = default)
Parameters
from
CurrencyTypesThe source currency type.
to
CurrencyTypesThe target currency type.
date
DateTimeThe date for which the conversion rate is applicable.
cancellationToken
CancellationTokenA cancellation token to monitor for cancellation requests.