Class StorageExtensions
Provides JSON reading for a Storage.
public static class StorageExtensions
- Inheritance
-
StorageExtensions
- Inherited Members
Methods
TryReadJson<T>(Storage, string, ILogger?)
Reads a file's JSON as an object, or the default where there is none to take: a missing file, as on a first run, goes unlogged, and one that cannot be read or parsed is logged.
public static T? TryReadJson<T>(this Storage storage, string name, ILogger? logger = null)
Parameters
storageStorageThe storage.
namestringThe file's name.
loggerILoggerThe logger a failure goes to, or null for none.
Returns
- T
The object, or the default.
Type Parameters
TThe object's type.