Skip to content

Conversation

@sputier
Copy link
Contributor

@sputier sputier commented Jul 16, 2018

This PR adds a snippet to demonstrate how to read attributes with C# at C# Attributes - A tour of the C# language

Fixes dotnet/docs#5424

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this sample @sputier It will add to the understanding of the topic.

We try to avoid Line numbers in includes because they are very brittle. Can you update this PR, and the associated docs PR, with the snippet I've recommended.

Thanks again for contributing to docs.

{
public static void Main(string[] args)
{
Type widgetType = typeof(Widget);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a marker here (and at the end) rather than using line numbers. Line numbers are very brittle in the OPS build. For example:

// <SnippetReadAttributes>

Console.WriteLine($"Display method help URL : {attr.Url} - Related topic : {attr.Topic}");
}

Console.ReadLine();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then, after this line, close the snippet:

// </SnippetReadAttributes>

@BillWagner BillWagner merged commit 67712bf into dotnet:master Jul 17, 2018
karelz pushed a commit to karelz/samples that referenced this pull request Aug 31, 2018
* Added sample code to read attributes for C# tour

* Replaced line numbers in samples with // <SnippetReadAttributes>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants