This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

JsonLdSerializer Pennington.StructuredData

Serializes any JsonLdEntity subclass to a JSON string safe for embedding in a <script type="application/ld+json"> tag.

Methods

Serialize

#
public static string Serialize(JsonLdEntity entity)

Serializes entity to JSON-LD. The concrete runtime type is used so subclass-only properties are included.

Parameters

entity JsonLdEntity

Returns

string

Pennington.StructuredData.JsonLdSerializer

namespace Pennington.StructuredData;

/// Serializes any JsonLdEntity subclass to a JSON string safe for embedding in a <script type="application/ld+json"> tag.
public class JsonLdSerializer
{
    /// Serializes entity to JSON-LD. The concrete runtime type is used so subclass-only properties are included.
    
public static string Serialize(JsonLdEntity entity)
; }