Table of Contents

MoneyConversionResult Struct

Definition

Namespace
Bodu.Financial
Assembly
Bodu.Financial.dll
Package
Bodu.Financial 1.0.0
Source
MoneyConversionResult.cs

Captures the audit trail of a single runtime-tagged currency conversion: the source and settled target amounts, the exchange rate applied, the monetary context that governed rounding, and how much rounding moved the result.

public readonly struct MoneyConversionResult : IEquatable<MoneyConversionResult>
Implements
Inherited Members
Extension Methods

Constructors

MoneyConversionResult(Money, Money, ExchangeRate, MonetaryContext, decimal?)

Captures the audit trail of a single runtime-tagged currency conversion: the source and settled target amounts, the exchange rate applied, the monetary context that governed rounding, and how much rounding moved the result.

public MoneyConversionResult(Money Source, Money Target, ExchangeRate Rate, MonetaryContext Context, decimal? RoundingAdjustment)

Parameters

Source Money

The original source amount.

Target Money

The converted amount, rounded according to Context.

Rate ExchangeRate

The exchange rate applied to produce Target.

Context MonetaryContext

The monetary context that governed rounding.

RoundingAdjustment decimal?

The signed difference between the rounded target amount and the exact (unrounded) converted amount, or null when rounding was deferred.

Properties

Context

The monetary context that governed rounding.

public MonetaryContext Context { get; init; }

Property Value

MonetaryContext

Rate

The exchange rate applied to produce Target.

public ExchangeRate Rate { get; init; }

Property Value

ExchangeRate

RoundingAdjustment

The signed difference between the rounded target amount and the exact (unrounded) converted amount, or null when rounding was deferred.

public decimal? RoundingAdjustment { get; init; }

Property Value

decimal?

Source

The original source amount.

public Money Source { get; init; }

Property Value

Money

Target

The converted amount, rounded according to Context.

public Money Target { get; init; }

Property Value

Money

Methods

Deconstruct(out Money, out Money, out ExchangeRate, out MonetaryContext, out decimal?)

public void Deconstruct(out Money Source, out Money Target, out ExchangeRate Rate, out MonetaryContext Context, out decimal? RoundingAdjustment)

Parameters

Source Money
Target Money
Rate ExchangeRate
Context MonetaryContext
RoundingAdjustment decimal?

Equals(MoneyConversionResult)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(MoneyConversionResult other)

Parameters

other MoneyConversionResult

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

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, MoneyConversionResult)

public static bool operator ==(MoneyConversionResult left, MoneyConversionResult right)

Parameters

left MoneyConversionResult
right MoneyConversionResult

Returns

bool

operator !=(MoneyConversionResult, MoneyConversionResult)

public static bool operator !=(MoneyConversionResult left, MoneyConversionResult right)

Parameters

left MoneyConversionResult
right MoneyConversionResult

Returns

bool

Applies to

ProductVersions
.NET8, 10