Table of Contents

RateObservation Struct

Definition

Namespace
Bodu.Financial.ExchangeRates
Assembly
Bodu.Financial.dll
Package
Bodu.Financial 1.0.0
Source
RateObservation.cs

Represents a single observed exchange rate on a specific calendar date for a series.

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

Remarks

This type is a lightweight value carrier used by the series API in preference to repeated (DateOnly, decimal) tuples. The surrounding series enforces the "strictly positive rate" and "unique date" invariants; values constructed in isolation (including default(RateObservation)) carry no validation guarantees.

Constructors

RateObservation(DateOnly, decimal)

Represents a single observed exchange rate on a specific calendar date for a series.

public RateObservation(DateOnly Date, decimal Rate)

Parameters

Date DateOnly

The calendar date on which the rate was observed.

Rate decimal

The observed rate. Must be strictly positive when consumed by an RateSeries or RateSeriesBuilder; the type itself does not validate the value because it is also used as a transport record in scenarios that produce default instances.

Remarks

This type is a lightweight value carrier used by the series API in preference to repeated (DateOnly, decimal) tuples. The surrounding series enforces the "strictly positive rate" and "unique date" invariants; values constructed in isolation (including default(RateObservation)) carry no validation guarantees.

Properties

Date

The calendar date on which the rate was observed.

public DateOnly Date { get; init; }

Property Value

DateOnly

Rate

The observed rate. Must be strictly positive when consumed by an RateSeries or RateSeriesBuilder; the type itself does not validate the value because it is also used as a transport record in scenarios that produce default instances.

public decimal Rate { get; init; }

Property Value

decimal

Methods

Deconstruct(out DateOnly, out decimal)

public void Deconstruct(out DateOnly Date, out decimal Rate)

Parameters

Date DateOnly
Rate decimal

Equals(RateObservation)

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

public bool Equals(RateObservation other)

Parameters

other RateObservation

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 ==(RateObservation, RateObservation)

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

Parameters

left RateObservation
right RateObservation

Returns

bool

operator !=(RateObservation, RateObservation)

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

Parameters

left RateObservation
right RateObservation

Returns

bool

Applies to

ProductVersions
.NET8, 10