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

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

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

WithPropertiesRenamed(JsonObject?, ILogger?, params (string oldName, string newName)[])

Returns the specified JsonObject with its properties renamed.

public static JsonObject? WithPropertiesRenamed(this JsonObject? documentData, ILogger? logger, params (string oldName, string newName)[] operations)

Parameters

documentData JsonObject

the JsonObject

logger ILogger

the ILogger

operations (string oldName, string newName)[]

specifies which JsonObject properties to rename

Returns

JsonObject

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