C# – Convert an object to JSON and vice versa

The simplest way to convert an object to JSON (serialization) is to use the built-in System.Text.Json.JsonSerializer: This serializes the Movie object to JSON using the default serialization settings (notice it’s not pretty printed by defualt). Here’s the JSON this produces: To do the opposite – convert a JSON string to an object (deserialization) – use … Read more