Table of Contents

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 CurrencyTypes

The source currency type.

to CurrencyTypes

The target currency type.

date DateTime

The date for which the conversion rate is applicable.

cancellationToken CancellationToken

A cancellation token to monitor for cancellation requests.

Returns

Task<decimal>

A task that represents the asynchronous operation. The task result contains the conversion rate as a decimal.