Table of Contents

Class IDictionaryExtensions

Namespace
Songhay.Publications.Extensions
Assembly
Songhay.Publications.dll
public static class IDictionaryExtensions
Inheritance
IDictionaryExtensions
Inherited Members

Methods

ToIDocumentJsonObject(IDictionary<string, object>?)

Converts the conventional, YamlDotNet dictionary to the conventional, Publications JsonObject

public static JsonObject? ToIDocumentJsonObject(this IDictionary<string, object>? data)

Parameters

data IDictionary<string, object>

the conventional, YamlDotNet dictionary

Returns

JsonObject

Remarks

The incoming YamlDotNet dictionary should have keys that match the property names of IDocument.

See Also

ToJsonString(IDictionary<string, object>?)

Converts the specified IDictionary<TKey, TValue> to a JSON string.

public static string ToJsonString(this IDictionary<string, object>? data)

Parameters

data IDictionary<string, object>

the IDictionary<TKey, TValue>

Returns

string

ToTaggedDocument(IDictionary<string, object>?, ILogger, params string[])

Converts the specified IDictionary<TKey, TValue> to IDocument

public static IDocument? ToTaggedDocument(this IDictionary<string, object>? data, ILogger logger, params string[] tagKeys)

Parameters

data IDictionary<string, object>

the IDictionary<TKey, TValue>

logger ILogger

the ILogger

tagKeys string[]

the keys to search for tagging the IDocument

Returns

IDocument

Remarks

Tagging the IDocument sets Tag with serialized JSON key-value pairs from:

  • the conventional key, extract
  • keys specified in tagKeys