JsonNotableDateCache Class
Definition
- Namespace
- Bodu.Globalization.Calendar.Caching
- Assembly
- Bodu.Globalization.Calendar.Caching.dll
- Package
- Bodu.Globalization.Calendar.Caching 1.0.0
- Source
- JsonNotableDateCache.cs
An INotableDateCache that persists computed years as JSON files, one file per territory.
public sealed class JsonNotableDateCache : FileNotableDateCacheBase, INotableDateCache
- Inheritance
-
JsonNotableDateCache
- Implements
- Inherited Members
- Extension Methods
Remarks
Structurally identical to TomlNotableDateCache but serialized with System.Text.Json:
the territory, an Entries array of per-year metadata, and a flat Occurrences array. Malformed content
is treated as an empty result, and all file-level resilience is provided by FileNotableDateCacheBase.
Constructors
JsonNotableDateCache(FileNotableDateCacheOptions, TimeProvider?, ILogger?)
Initializes a new instance of the JsonNotableDateCache class.
public JsonNotableDateCache(FileNotableDateCacheOptions options, TimeProvider? timeProvider = null, ILogger? logger = null)
Parameters
optionsFileNotableDateCacheOptionsThe file-cache options that select the storage directory.
timeProviderTimeProviderThe time source the swallowed-failure warning rate-limiting is measured against, or null to use System.
loggerILoggerThe logger that receives a rate-limited warning when a best-effort storage failure is swallowed, or null to disable that reporting.
Exceptions
- ArgumentNullException
Thrown when
optionsis null.- ArgumentException
Thrown when
optionsfails validation.
Properties
FileExtension
Gets the file extension used by the concrete format, including the leading dot.
protected override string FileExtension { get; }
Property Value
- string
The file extension, such as
.tomlor.json.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |