Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

json serialization

"if youre using System.Text.Json extention"
1. Serialize allows you to convert objects to a json format string:

string defaultPerson = JsonSerializer.Serialize(new Person{
  age = 28,
  nationality = "scottish"
  }) 
  
2. Deserialize allows you to convert json format string to an object:
   ScottishPerson = JsonSerializer.Deserialize<Person>(defaultPerson); 
 
PREVIOUS NEXT
Tagged: #json #serialization
ADD COMMENT
Topic
Name
5+3 =