Class ExchangeRateMultiplier
Inheritance
ExchangeRateMultiplier
Assembly: cs.temp.dll.dll
Syntax
public class ExchangeRateMultiplier : IExchangeRateMultiplier, IEntity, IInjectable
Constructors
ExchangeRateMultiplier(String)
Declaration
public ExchangeRateMultiplier(string id)
Parameters
Type |
Name |
Description |
String |
id |
|
Fields
_dataService
Declaration
protected IDataService _dataService
Field Value
Type |
Description |
IDataService |
|
_exchangeRateMultiplierData
Declaration
protected IExchangeRateMultiplierData _exchangeRateMultiplierData
Field Value
_id
Declaration
protected readonly string _id
Field Value
Properties
ExchangeRateMultiplierData
Declaration
public virtual IExchangeRateMultiplierData ExchangeRateMultiplierData { get; }
Property Value
Id
Declaration
public virtual string Id { get; }
Property Value
Methods
Cleanup(IEntityLoaderService)
Declaration
public virtual void Cleanup(IEntityLoaderService entityLoaderService)
Parameters
Declaration
public virtual double GetExchangeInputAmount(IExchangeable inputExchangeable, IExchangeable outputExchangeable, double requiredAmount)
Parameters
Returns
GetRate(IExchangeable, IExchangeable)
Declaration
public virtual double GetRate(IExchangeable inputExchangeable, IExchangeable outputExchangeable)
Parameters
Returns
GetRate(Double, Double)
Calculates an exchange rate based on the input and output currency's value, taking into account Multiplier
Declaration
protected virtual double GetRate(double inputExchangeValue, double outputExchangeValue)
Parameters
Type |
Name |
Description |
Double |
inputExchangeValue |
|
Double |
outputExchangeValue |
|
Returns
Examples
Given input currency ICurrency "A" with value 20 and an ICurrency "B" with value 1,
invoking "GetRate(IExchangeable, IExchangeable)(A, B)" would return 20. This means "A" is 20 times more valuable than "B", and 1 "A" is
worth 20 "B". If the Multiplier was 1.5, it would instead return in 30.
Initialize()
Declaration
public virtual void Initialize()
Inject(IResolver)
Declaration
public virtual void Inject(IResolver resolver)
Parameters
Type |
Name |
Description |
IResolver |
resolver |
|
Implements
IInjectable