From 1097e54e9e8f6932d5b11e4b099bd71cb51fadac Mon Sep 17 00:00:00 2001 From: Bhargav Nookala Date: Mon, 5 Dec 2016 19:01:33 +0800 Subject: [PATCH] Updating WebApiClient Adding missing `using` statements --- docs/csharp/tutorials/console-webapiclient.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/csharp/tutorials/console-webapiclient.md b/docs/csharp/tutorials/console-webapiclient.md index 6ca4b5c51b1c7..1ccabae6af5d6 100644 --- a/docs/csharp/tutorials/console-webapiclient.md +++ b/docs/csharp/tutorials/console-webapiclient.md @@ -209,6 +209,8 @@ type to contain the information you use from this response. Let's build this slo a simple C# type that contains the name of the repository: ```cs +using System; + namespace WebAPIClient { public class repo @@ -474,9 +476,17 @@ Let's go over the new constructs above. The `IgnoreDataMember` attribute instruc that this type should not be read to or written from any JSON object. This property contains only a `get` accessor. There is no `set` accessor. That's how you define a *read only* property in C#. (Yes, you can create *write only* properties in C#, but their value is limited.) The `DateTime.ParseExact` -method parses a string and creates a `DateTime` object to return. If the parse operation fails, the +method parses a string and creates a `DateTime` object using a provided date format, and adds additional +metadata to the `DateTime` using a `CultureInfo` object. If the parse operation fails, the property accessor throws an exception. +To use `CultureInfo.InvariantCulture`, you will need to add `System.Globalization` to the using statements +in `repo.cs`: + +```cs +using System.Globalization; +``` + Finally, add one more output statement in the console, and you're ready to build and run this app again: