Answers for "jobject alternative in system.text.json"

C#
0

jobject alternative in system.text.json

public class MyDTO
{
    public JsonElement ExtractedData {get;set;} = JsonExtensions.Null;
}

public static class JsonExtensions
{
    static readonly JsonElement nullElement = CreateNull();

    public static JsonElement Null => nullElement;

    static JsonElement CreateNull()
    {
        using var doc = JsonDocument.Parse("null");
        return doc.RootElement.Clone();
    }
}
Posted by: Guest on September-07-2021

Code answers related to "jobject alternative in system.text.json"

C# Answers by Framework

Browse Popular Code Answers by Language