JsonContent.Serialize

JsonContent.Serialize method

Converts the value of a specified type into a JsonContent using JsonSerializer.

public static JsonContent Serialize(object value, JsonSerializerOptions options = null)
ParameterTypeDescription
valueObjectThe value to convert.
optionsJsonSerializerOptionsOptions to control the conversion behavior.

Return Value

A JsonContent object.

See Also