METHOD

JsonSerializer.Serialize

Produces JSON for a typed value with selected options.

Formal Syntax & Structure

csharp syntaxcsharp
JsonSerializer.Serialize<TValue>(value, options)

Working Example

Example Snippetcsharp
// Documentary fragment; see lesson for context and imports.JsonSerializer.Serialize(item);
C# & .NET Reference