Search Results for

    Show / Hide Table of Contents

    Class ExchangeRateRetriever

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

    Inheritance
    System.Object
    ExchangeRateRetriever
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.API.Processors
    Assembly: API.dll
    Syntax
    public class ExchangeRateRetriever

    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)

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

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

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

    The currency to retrieve the closest exchange rate from

    System.Guid toCurrency

    The currency to find the closest exchange rate to

    System.DateTime forDate

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

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Decimal>

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

    GetExchangeRate(Guid, Guid, DateTime, Nullable<Guid>)

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

    Takes care of recpirocal 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
    System.Guid fromCurrency

    The currency to retrieve the closest exchange rate from

    System.Guid toCurrency

    The currency to find the closest exchange rate to

    System.DateTime forDate

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

    System.Nullable<System.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
    System.Threading.Tasks.Task<System.Decimal>

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

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToCSVFormatString(Object, Type)
    SQLExtensions.ToSQLValue(Object, Boolean)
    In This Article
    Back to top © LemonEdge Technology. All rights reserved.