From 756764677dec6b9e0c3a48f63940ad5c62634ca0 Mon Sep 17 00:00:00 2001 From: Youssef Victor <31348972+Youssef1313@users.noreply.github.com> Date: Thu, 29 Aug 2019 20:36:21 +0200 Subject: [PATCH] Follow coding conventions (#1363) * Follow coding conventions * Update custom-writing-with-utf8jsonwriter.cs * Update snippets/standard/datetime/json/custom-writing-with-utf8jsonwriter.cs Co-Authored-By: Ron Petrusha --- .../datetime/json/custom-reading-with-utf8jsonreader.cs | 2 +- .../datetime/json/custom-writing-with-utf8jsonwriter.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/snippets/standard/datetime/json/custom-reading-with-utf8jsonreader.cs b/snippets/standard/datetime/json/custom-reading-with-utf8jsonreader.cs index 4e3d38b403d..cf66f7ba081 100644 --- a/snippets/standard/datetime/json/custom-reading-with-utf8jsonreader.cs +++ b/snippets/standard/datetime/json/custom-reading-with-utf8jsonreader.cs @@ -9,7 +9,7 @@ public static void Main(string[] args) { byte[] utf8Data = Encoding.UTF8.GetBytes(@"""Friday, 26 July 2019 00:00:00"""); - Utf8JsonReader json = new Utf8JsonReader(utf8Data); + var json = new Utf8JsonReader(utf8Data); while (json.Read()) { if (json.TokenType == JsonTokenType.String) diff --git a/snippets/standard/datetime/json/custom-writing-with-utf8jsonwriter.cs b/snippets/standard/datetime/json/custom-writing-with-utf8jsonwriter.cs index 70e3f942817..b9b311f08c5 100644 --- a/snippets/standard/datetime/json/custom-writing-with-utf8jsonwriter.cs +++ b/snippets/standard/datetime/json/custom-writing-with-utf8jsonwriter.cs @@ -8,14 +8,14 @@ public class Example { public static void Main(string[] args) { - JsonWriterOptions options = new JsonWriterOptions + var options = new JsonWriterOptions { Indented = true }; - using (MemoryStream stream = new MemoryStream()) + using (var stream = new MemoryStream()) { - using (Utf8JsonWriter writer = new Utf8JsonWriter(stream, options)) + using (var writer = new Utf8JsonWriter(stream, options)) { string dateStr = DateTime.UtcNow.ToString("F", CultureInfo.InvariantCulture); @@ -31,7 +31,7 @@ public static void Main(string[] args) } } -// The example displays the following output: +// The example displays output similar to the following: // { // "date": "Tuesday, 27 August 2019 19:21:44", // "temp": 42