Table of Contents

RateCacheFileContext Struct

Definition

Namespace
Bodu.Financial.ExchangeRates.Caching
Assembly
Bodu.Financial.ExchangeRates.Caching.dll
Package
Bodu.Financial.ExchangeRates.Caching 1.0.0
Source
RateCacheFileContext.cs

Supplies the inputs a file-name resolver needs to name a single cache file: the bound provider, the currency pair, the partition key, and the format's file extension.

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

Remarks

Passed to the file-name delegate of an RateCacheFileLayout. For a single-file layout the PartitionKey is the empty string; for a partitioned layout it is the partition's key (for example 2023-01 for a monthly partition).

Constructors

RateCacheFileContext(string, CurrencyPair, string, string)

Initializes a new instance of the RateCacheFileContext struct.

public RateCacheFileContext(string provider, CurrencyPair pair, string partitionKey, string fileExtension)

Parameters

provider string

The provider the cache is bound to.

pair CurrencyPair

The currency pair the file holds.

partitionKey string

The partition key, or the empty string for a single-file layout.

fileExtension string

The file extension, including the leading period, applied by the serialization format.

Properties

FileExtension

Gets the file extension, including the leading period, applied by the serialization format.

public string FileExtension { get; }

Property Value

string

The file extension, for example .toml.

Pair

Gets the currency pair the file holds.

public CurrencyPair Pair { get; }

Property Value

CurrencyPair

The currency pair.

PartitionKey

Gets the partition key the file holds.

public string PartitionKey { get; }

Property Value

string

The partition key, or the empty string for a single-file layout.

Provider

Gets the provider the cache is bound to.

public string Provider { get; }

Property Value

string

The provider identifier.

Methods

Equals(RateCacheFileContext)

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

public bool Equals(RateCacheFileContext other)

Parameters

other RateCacheFileContext

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

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

Parameters

left RateCacheFileContext
right RateCacheFileContext

Returns

bool

operator !=(RateCacheFileContext, RateCacheFileContext)

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

Parameters

left RateCacheFileContext
right RateCacheFileContext

Returns

bool

Applies to

ProductVersions
.NET8, 10