Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds missing using statements in dotnet core tutorial #1304

Merged
merged 1 commit into from
Dec 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docs/csharp/tutorials/console-webapiclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand Down