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
providerstringThe provider the cache is bound to.
pairCurrencyPairThe currency pair the file holds.
partitionKeystringThe partition key, or the empty string for a single-file layout.
fileExtensionstringThe 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
otherRateCacheFileContextAn 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 ==(RateCacheFileContext, RateCacheFileContext)
public static bool operator ==(RateCacheFileContext left, RateCacheFileContext right)
Parameters
leftRateCacheFileContextrightRateCacheFileContext
Returns
operator !=(RateCacheFileContext, RateCacheFileContext)
public static bool operator !=(RateCacheFileContext left, RateCacheFileContext right)
Parameters
leftRateCacheFileContextrightRateCacheFileContext
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |