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 #5424

Related PR in dotnet/samples : dotnet/samples#186

@sputier sputier requested a review from BillWagner as a code owner July 16, 2018 22:15
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.

Once again, thanks @sputier This is a great addition.

The only change I would make is to update the snippet reference to use a named snippet rather than line numbers.


The following code sample demonstrates how to get the `HelpAttribute` instances associated to the `Widget` class and its `Display` method.

[!code-csharp[AttributeRead](../../../samples/snippets/csharp/tour/attributes/Program.cs#L34-L54)]
Copy link
Member

Choose a reason for hiding this comment

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

Rather than the line numbers, let's use a snippet reference:

[!code-csharpAttributeRead]

(If you name the snippet as I did in the samples PR)

@sputier
Copy link
Contributor Author

sputier commented Jul 17, 2018

I made the requested change 😄

@BillWagner
Copy link
Member

closing and reopening to force a build now that the samples PR is merged.

@BillWagner BillWagner closed this Jul 17, 2018
@BillWagner BillWagner reopened this Jul 17, 2018
@BillWagner BillWagner merged commit a3375e7 into dotnet:master Jul 17, 2018
@sputier sputier deleted the #5424_attribute_reflection branch September 21, 2021 21:43
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