Fixing outdated method name (dotnet/corefx#41285)
authoroleggolovkovuss <48438421+oleggolovkovuss@users.noreply.github.com>
Tue, 24 Sep 2019 19:54:36 +0000 (22:54 +0300)
committerStephen Toub <stoub@microsoft.com>
Tue, 24 Sep 2019 19:54:36 +0000 (12:54 -0700)
.Net Core release notes lead to this sample for JSON serializing, it's using non-existent static `ToString` method though, this changes updates the docs

Commit migrated from https://github.com/dotnet/corefx/commit/629eea822f258f8d5771b96286eba8ff8c89d997

src/libraries/System.Text.Json/docs/SerializerProgrammingModel.md

index 6c5dc08..b22fa6b 100644 (file)
@@ -35,7 +35,7 @@ To deserialize a JSON string into a POCO instance:
 To serialize an object to a JSON string:
 ```cs
     Person person = ...
-    string json = JsonSerializer.ToString(person);
+    string json = JsonSerializer.Serialize(person);
 ```
 
 Note there are also byte[]-based methods of these which are faster than using the string-based methods because the bytes (as UTF8) do not need to be converted to\from string (UTF16).