Table of Contents

Class JsonObjectExtensions

Namespace
Songhay.Publications.Extensions
Assembly
Songhay.Publications.dll

Extensions of JsonObject

public static class JsonObjectExtensions
Inheritance
JsonObjectExtensions
Inherited Members

Methods

GetSerializedTagsAndCustomProperties(JsonObject?, ILogger)

Returns a serialized JSON string, according to the conventions for Tag.

public static string? GetSerializedTagsAndCustomProperties(this JsonObject? documentData, ILogger logger)

Parameters

documentData JsonObject

the JsonObject

logger ILogger

the ILogger

Returns

string

Remarks

This member expects to see a JsonObject with several properties with names prefixed with rx and a tags property.

This implies that the JsonObject is generated from a Markdown file and this member is being used to save into a Publications database.

ToIDocument(JsonObject?, ILogger)

Converts the JsonObject into a newly allocated instance of IDocument.

public static IDocument ToIDocument(this JsonObject? documentData, ILogger logger)

Parameters

documentData JsonObject

the JsonObject

logger ILogger

the ILogger

Returns

IDocument
See Also

ToYaml(JsonObject?, ILogger)

Converts the specified JsonElement to a YAML string.

public static string? ToYaml(this JsonObject? documentData, ILogger logger)

Parameters

documentData JsonObject

the JsonObject

logger ILogger

the ILogger

Returns

string

Update(JsonObject?, IDocument?)

Updates the JsonObject with the specified instance of IDocument.

public static void Update(this JsonObject? documentData, IDocument? document)

Parameters

documentData JsonObject

the JsonObject

document IDocument

the IDocument

See Also

WithArrayProperty(JsonObject?, string?)

Returns the specified JsonObject with a JsonArray property.

public static JsonObject? WithArrayProperty(this JsonObject? jsonObject, string? arrayPropertyName)

Parameters

jsonObject JsonObject

the JsonObject

arrayPropertyName string

the property name of the array

Returns

JsonObject

WithExtract(JsonObject?, IReadOnlyCollection<string>?, int, ILogger)

Returns the specified JsonObject with a Publications extract.

public static JsonObject? WithExtract(this JsonObject? documentData, IReadOnlyCollection<string>? contentLines, int extractLength, ILogger logger)

Parameters

documentData JsonObject

the JsonObject

contentLines IReadOnlyCollection<string>

the collection of content lines

extractLength int

the length of the extract

logger ILogger

the ILogger

Returns

JsonObject

WithIndexDocumentProperties(JsonObject?, string?, ILogger)

Returns the specified JsonObject with the conventional Index-document properties for Studio Publications.

public static JsonObject WithIndexDocumentProperties(this JsonObject? documentData, string? tag, ILogger logger)

Parameters

documentData JsonObject

the JsonObject

tag string

the value of Tag

logger ILogger

the ILogger

Returns

JsonObject
See Also

WithoutConventionalDocumentProperties(JsonObject?, ILogger)

Returns the specified JsonObject without the properties that should display in front matter.

public static JsonObject? WithoutConventionalDocumentProperties(this JsonObject? documentData, ILogger logger)

Parameters

documentData JsonObject

the JsonObject

logger ILogger

the ILogger

Returns

JsonObject

WithoutNonNullableDocumentProperties(JsonObject?, ILogger)

Returns the specified JsonObject without the properties that are null and marked DisallowNull.

public static JsonObject? WithoutNonNullableDocumentProperties(this JsonObject? documentData, ILogger logger)

Parameters

documentData JsonObject

the JsonObject

logger ILogger

the ILogger

Returns

JsonObject