Search Results for

    Show / Hide Table of Contents

    Class ExchangeRateRetriever

    A helper class responsible for retrieving, and caching, exchange rates.

    Inheritance
    object
    ExchangeRateRetriever
    Implements
    IExchangeRateRetriever
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.API.Core.FinancialServices.Processors
    Assembly: LemonEdge.API.Core.FinancialServices.dll
    Syntax
    public class ExchangeRateRetriever : IExchangeRateRetriever

    Constructors

    ExchangeRateRetriever(IEntityRetriever)

    Create a new exchange rate retriever powered by the specified retriever

    Declaration
    public ExchangeRateRetriever(IEntityRetriever retriever)
    Parameters
    Type Name Description
    IEntityRetriever retriever

    A context enabling querying of all data in the system

    Methods

    GetExchangeRate(Guid, Guid, DateTime, Guid?)

    Provides the exchange rate to use when converting from a currency to another one for the specified date

    Takes care of reciprocal rates automatically, always providing the rate fromCurrency -> toCurrency

    Declaration
    public Task<decimal> GetExchangeRate(Guid fromCurrency, Guid toCurrency, DateTime forDate, Guid? exchangeRateCategoryID)
    Parameters
    Type Name Description
    Guid fromCurrency

    The currency to retrieve the closest exchange rate from

    Guid toCurrency

    The currency to find the closest exchange rate to

    DateTime forDate

    The date that the exchange rate must be closest to, and less than or equal to

    Guid? exchangeRateCategoryID

    The exchange rate category these exchange rates should be retrieved from. NUll indicates the default exchange rates with no category.

    Returns
    Type Description
    Task<decimal>

    The rate to apply to convert from fromCurrency -> toCurrency for the specified date

    Implements

    IExchangeRateRetriever

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.