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
JsonObjectthe JsonObject
logger
ILoggerthe ILogger
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
documentData
JsonObjectthe JsonObject
contentLines
IReadOnlyCollection<string>the collection of content lines
extractLength
intthe length of the extract
logger
ILoggerthe ILogger
Returns
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
JsonObjectthe JsonObject
logger
ILoggerthe ILogger
operations
(string oldName, string newName)[]specifies which JsonObject properties to rename
Returns
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
JsonObjectthe JsonObject
logger
ILoggerthe 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
documentData
JsonObjectthe JsonObject
logger
ILoggerthe ILogger