IJsonData
interface IJsonData
Represents an object that contains JSON serialized data. This interface is used to
identify a JsonData<T> without needing to have the generic type information.
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Text.Json;
namespace System.Private.Windows
{
[NullableContext(1)]
internal interface IJsonData
{
const string CustomAssemblyName = "System.Private.Windows.VirtualJson";
byte[] JsonBytes { get; set; }
string InnerTypeAssemblyQualifiedName { get; }
[RequiresUnreferencedCode("Calls System.Text.Json.JsonSerializer.Deserialize<TValue>(ReadOnlySpan<Byte>, JsonSerializerOptions)")]
object Deserialize();
[RequiresUnreferencedCode("Calls System.Text.Json.JsonSerializer.SerializeToUtf8Bytes<TValue>(TValue, JsonSerializerOptions)")]
IJsonData Create<[Nullable(2)] T>(T data)
{
JsonData<T> jsonData = default(JsonData<T>);
jsonData.JsonBytes = JsonSerializer.SerializeToUtf8Bytes(data, (JsonSerializerOptions)null);
return jsonData;
}
}
}