Skip to content

Commit 0c5dcc4

Browse files
authored
Fix code for 3.0 whats new (#1191)
1 parent e5328a7 commit 0c5dcc4

File tree

1 file changed

+3
-3
lines changed
  • snippets/core/whats-new/whats-new-in-30/cs

1 file changed

+3
-3
lines changed

snippets/core/whats-new/whats-new-in-30/cs/JSON.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ public string WriteJSON()
1616
Age = 18
1717
};
1818

19-
System.Console.WriteLine(System.Text.Json.Serialization.JsonSerializer.ToString(instance));
19+
System.Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(instance));
2020
// </SnippetJsonSerialize>
2121

22-
return System.Text.Json.Serialization.JsonSerializer.ToString(instance);
22+
return System.Text.Json.JsonSerializer.Serialize(instance);
2323
}
2424
}
2525

@@ -31,7 +31,7 @@ public class JsonPerson
3131
public int Age { get; set; }
3232

3333
public static JsonPerson Parse(string json) =>
34-
System.Text.Json.Serialization.JsonSerializer.Parse<JsonPerson>(json);
34+
System.Text.Json.JsonSerializer.Deserialize<JsonPerson>(json);
3535
}
3636
// </SnippetJsonDeserialize>
3737
}

0 commit comments

Comments
 (0)