MoneyConversionResult<TSource, TTarget> Struct
Definition
- Assembly
- Bodu.Financial.dll
- Package
- Bodu.Financial 1.0.0
Bundles the result of a single end-to-end strongly-typed money conversion together with the exchange-rate metadata that produced it, so consumers can audit which observed rate was used.
public readonly struct MoneyConversionResult<TSource, TTarget> : IEquatable<MoneyConversionResult<TSource, TTarget>> where TSource : ICurrency where TTarget : ICurrency
Type Parameters
TSourceThe source currency.
TTargetThe destination currency.
- Implements
-
IEquatable<MoneyConversionResult<TSource, TTarget>>
- Inherited Members
- Extension Methods
Constructors
MoneyConversionResult(Money<TSource>, Money<TTarget>, RateLookupResult)
Bundles the result of a single end-to-end strongly-typed money conversion together with the exchange-rate metadata that produced it, so consumers can audit which observed rate was used.
public MoneyConversionResult(Money<TSource> SourceAmount, Money<TTarget> TargetAmount, RateLookupResult ExchangeRate)
Parameters
SourceAmountMoney<TSource>The original source amount.
TargetAmountMoney<TTarget>The converted, rounded target amount.
ExchangeRateRateLookupResultThe full lookup result, including provider, dates, and inversion flag, used to compute
TargetAmount.
Properties
ExchangeRate
The full lookup result, including provider, dates, and inversion flag, used to compute
TargetAmount.
public RateLookupResult ExchangeRate { get; init; }
Property Value
SourceAmount
The original source amount.
public Money<TSource> SourceAmount { get; init; }
Property Value
- Money<TSource>
TargetAmount
The converted, rounded target amount.
public Money<TTarget> TargetAmount { get; init; }
Property Value
- Money<TTarget>
Methods
Deconstruct(out Money<TSource>, out Money<TTarget>, out RateLookupResult)
public void Deconstruct(out Money<TSource> SourceAmount, out Money<TTarget> TargetAmount, out RateLookupResult ExchangeRate)
Parameters
SourceAmountMoney<TSource>TargetAmountMoney<TTarget>ExchangeRateRateLookupResult
Equals(MoneyConversionResult<TSource, TTarget>)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(MoneyConversionResult<TSource, TTarget> other)
Parameters
otherMoneyConversionResult<TSource, TTarget>An object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(MoneyConversionResult<TSource, TTarget>, MoneyConversionResult<TSource, TTarget>)
public static bool operator ==(MoneyConversionResult<TSource, TTarget> left, MoneyConversionResult<TSource, TTarget> right)
Parameters
leftMoneyConversionResult<TSource, TTarget>rightMoneyConversionResult<TSource, TTarget>
Returns
operator !=(MoneyConversionResult<TSource, TTarget>, MoneyConversionResult<TSource, TTarget>)
public static bool operator !=(MoneyConversionResult<TSource, TTarget> left, MoneyConversionResult<TSource, TTarget> right)
Parameters
leftMoneyConversionResult<TSource, TTarget>rightMoneyConversionResult<TSource, TTarget>
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |