Class ExchangeRate
Assembly: LemonEdge.API.Entities.FinancialServices.Auto.dll
Syntax
[DataContract]
[MultipleUnique(new string[] { "EffectiveDate", "FromCurrencyID", "ToCurrencyID", "CategoryID" }, AllowNullOrEmpty = true)]
public class ExchangeRate : BaseEntity, IExchangeRate, IBaseEntity, IEquatable<IBaseEntity>, INotifyPropertyChanged, INotifyPropertyChanging, ICloneableAsync, ICanTrackProperties, ICloneableAsync<IExchangeRate>
Constructors
ExchangeRate()
Declaration
Properties
CategoryID
[Key] Links to IExchangeRateCategory. The optional category this exchange rate is under. Empty
indicates the default category.
Declaration
public Guid? CategoryID { get; set; }
Property Value
CategoryID_Label
Declaration
public string CategoryID_Label { get; set; }
Property Value
CategoryID_Label_Silent
Declaration
[NotMapped]
public string CategoryID_Label_Silent { get; set; }
Property Value
EffectiveDate
[Key] The date the exchange rate is effective from
Declaration
[Required]
public DateTimeOffset EffectiveDate { get; set; }
Property Value
FromCurrencyID
[Key] Links to ICurrency. The Currency this exchange rate is exchanging from
Declaration
[RequiredNoDefaultIDValidation]
[PropertyValidation("true", "MyItem.FromCurrencyID != MyItem.ToCurrencyID", "From currency and to currency can't be the same.")]
public Guid FromCurrencyID { get; set; }
Property Value
FromCurrencyID_Label
Declaration
public string FromCurrencyID_Label { get; set; }
Property Value
FromCurrencyID_Label_Silent
Declaration
[NotMapped]
public string FromCurrencyID_Label_Silent { get; set; }
Property Value
Rate
The exchange rate value to exchange from the From Currency to the To Currency
Declaration
[Required]
public decimal Rate { get; set; }
Property Value
ToCurrencyID
[Key] Links to ICurrency. The Currency this exchange rate is exchanging to
Declaration
[RequiredNoDefaultIDValidation]
[PropertyValidation("true", "MyItem.FromCurrencyID != MyItem.ToCurrencyID", "From currency and to currency can't be the same.")]
public Guid ToCurrencyID { get; set; }
Property Value
ToCurrencyID_Label
Declaration
public string ToCurrencyID_Label { get; set; }
Property Value
ToCurrencyID_Label_Silent
Declaration
[NotMapped]
public string ToCurrencyID_Label_Silent { get; set; }
Property Value
Methods
CopyFromEntity(IBaseEntity)
Declaration
protected override void CopyFromEntity(IBaseEntity src)
Parameters
Overrides
CopyFromSource(IExchangeRate)
Updates all properties in this item to have the same properties as the source object.
Declaration
public void CopyFromSource(IExchangeRate source)
Parameters
Type |
Name |
Description |
IExchangeRate |
source |
The source object to copy all values from.
|
GetExchangeRate(Guid)
Get the exchange rate to the specified currency.
The system doesn't store reciprocal rates, so if this is a rate from the required currency it has to calculate the reciprocal
Declaration
public decimal GetExchangeRate(Guid toCurrencyID)
Parameters
Type |
Name |
Description |
Guid |
toCurrencyID |
|
Returns
Type |
Description |
decimal |
The exchange rate to the specified currency
|
Implements
Extension Methods