<PackageReference Include="System.Text.Json" Version="10.0.0" />

JsonMarshal

public static class JsonMarshal
An unsafe class that provides a set of methods to access the underlying data representations of JSON types.
using System.Text.Json; namespace System.Runtime.InteropServices { public static class JsonMarshal { public static ReadOnlySpan<byte> GetRawUtf8Value(JsonElement element) { return element.GetRawValue().Span; } public static ReadOnlySpan<byte> GetRawUtf8PropertyName(JsonProperty property) { return property.NameSpan; } } }