Skip to content

Commit

Permalink
Follow coding conventions (#1363)
Browse files Browse the repository at this point in the history
* Follow coding conventions

* Update custom-writing-with-utf8jsonwriter.cs

* Update snippets/standard/datetime/json/custom-writing-with-utf8jsonwriter.cs

Co-Authored-By: Ron Petrusha <[email protected]>
  • Loading branch information
Youssef1313 and Ron Petrusha committed Aug 29, 2019
1 parent d4bb871 commit 7567646
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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
Expand Down

0 comments on commit 7567646

Please sign in to comment.