JSON Serialization

noun

say it: “JAY-sun seer-ee-uh-lih-ZAY-shun” /ˈdʒeɪsən ˌsɪəriələˈzeɪʃən/

Turning an object into JSON text, or JSON text back into an object.

What is JSON Serialization in C#?

JSON Serialization — Converting an object to JSON text or reconstructing an object from JSON.

using System.Text.Json;

class OrderWriter
{
    string ToJson(Order order)
    {
        return JsonSerializer.Serialize(order);
    }
}

record Order(string Item);

In a sentence

  • “JSON serialization turned our Product into {"productName":"Chai",...}.”

Level: Journeyman · More C# terms at this level

Updated