MemoryPluginRecords
Class in Oadm.Sdk.Plugins · Oadm.Sdk.dll
IPluginRecords in memory (tests, hosts without a database): the same checks as the database, lost when the process ends.
public sealed class MemoryPluginRecords : IPluginRecordsImplements IPluginRecords
Properties
Section titled “Properties”WrittenRecords
Section titled “WrittenRecords”int WrittenRecords { get; }Every write of MemoryPluginRecords.SetManyAsync so far (tests check that only changed records are written).
Methods
Section titled “Methods”ClearAsync
Section titled “ClearAsync”Task ClearAsync(string collection, CancellationToken ct)Deletes every record of collection.
GetAsync
Section titled “GetAsync”Task<string?> GetAsync(string collection, string key, CancellationToken ct)One record of collection: its JSON, or null when there is none of key. Reads only that record (default for other implementations: through IPluginRecords.ListAsync).
ListAsync
Section titled “ListAsync”Task<IReadOnlyDictionary<string, string>> ListAsync(string collection, CancellationToken ct)Every record of collection: key and JSON.
SetManyAsync
Section titled “SetManyAsync”Task SetManyAsync(string collection, IReadOnlyCollection<KeyValuePair<string, string?>> records, CancellationToken ct)Writes several records of collection in one transaction; a null value deletes its key. Keys: 1 to 255 characters; values: valid JSON.