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
documentDataJsonObjectthe JsonObject
loggerILoggerthe ILogger
Returns
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
documentDataJsonObjectthe JsonObject
loggerILoggerthe ILogger
Returns
- See Also
ToYaml(JsonObject?, ILogger)
Converts the specified JsonElement to a YAML string.
public static string? ToYaml(this JsonObject? documentData, ILogger logger)
Parameters
documentDataJsonObjectthe JsonObject
loggerILoggerthe ILogger
Returns
Update(JsonObject?, IDocument?)
Updates the JsonObject with the specified instance of IDocument.
public static void Update(this JsonObject? documentData, IDocument? document)
Parameters
documentDataJsonObjectthe JsonObject
documentIDocumentthe IDocument
- See Also
WithArrayProperty(JsonObject?, string?)
Returns the specified JsonObject with a JsonArray property.
public static JsonObject? WithArrayProperty(this JsonObject? jsonObject, string? arrayPropertyName)
Parameters
jsonObjectJsonObjectthe JsonObject
arrayPropertyNamestringthe property name of the array
Returns
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
documentDataJsonObjectthe JsonObject
contentLinesIReadOnlyCollection<string>the collection of content lines
extractLengthintthe length of the extract
loggerILoggerthe ILogger
Returns
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
documentDataJsonObjectthe JsonObject
tagstringthe value of Tag
loggerILoggerthe ILogger
Returns
- 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
documentDataJsonObjectthe JsonObject
loggerILoggerthe ILogger
Returns
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
documentDataJsonObjectthe JsonObject
loggerILoggerthe ILogger