Table of Contents

NullImfReportCache Class

Definition

Namespace
Bodu.Financial.ExchangeRates
Assembly
Bodu.Financial.ExchangeRates.Imf.dll
Package
Bodu.Financial.ExchangeRates.Imf 0.7.1
Source
NullImfReportCache.cs

An IImfReportCache that stores nothing, used when on-disk caching is disabled.

public sealed class NullImfReportCache : IImfReportCache
Inheritance
NullImfReportCache
Implements
Inherited Members
Extension Methods

Properties

Instance

Gets the shared instance of the no-op cache.

public static NullImfReportCache Instance { get; }

Property Value

NullImfReportCache

The singleton NullImfReportCache.

Methods

Store(ImfReportMonth, byte[])

Stores the bytes for a report month, replacing any existing entry.

public void Store(ImfReportMonth month, byte[] bytes)

Parameters

month ImfReportMonth

The report month whose file is being cached.

bytes byte[]

The report bytes to store.

TryGet(ImfReportMonth, TimeSpan, out byte[])

Attempts to retrieve the cached bytes for a report month.

public bool TryGet(ImfReportMonth month, TimeSpan refreshInterval, out byte[] bytes)

Parameters

month ImfReportMonth

The report month whose file is requested.

refreshInterval TimeSpan

The maximum age at which a current-month report is still considered fresh.

bytes byte[]

When this method returns true, the cached report bytes; otherwise null.

Returns

bool

true when a fresh cache entry exists; otherwise false.

Applies to

ProductVersions
.NET8, 10