Skip to content

Conversation

@DevonAleshire
Copy link
Contributor

Summary

Minor updates to Index initializer verbiage adding that Dictionary is still able to be initialized using collection initializer and focusing change on the fact that we are now using indexer allowing users to be more consistent with its actual usage/assignment.

Fixes #Issue_Number 5169

@DevonAleshire DevonAleshire requested a review from BillWagner as a code owner May 21, 2018 00:46
initializers more consistent. In earlier releases of C#, you could use
*collection initializers* only with sequence style collections:
initializers more consistent with index usage. In earlier releases of C#, you could use
*collection initializers* only with sequence style collections, including <xref:System.Collections.Generic.Dictionary%602> with braces around Key-Vlue pairs:
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a typo and what about rephrasing: ...around Key-Vlue pairs -> ...around key and value pairs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pkulikov My sincere apologies. I did not mean for that to happen. I was sick that day so stayed home and was looking at what opportunities were available. Will update accordingly, and thank you for your recommendation. Greatly appreciated!

Copy link
Contributor

Choose a reason for hiding this comment

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

@DevonAleshire thank you very much for updating the text.

[!code-csharp[ListInitializer](../../../samples/snippets/csharp/new-in-6/initializers.cs#ListInitializer)]

Now, you can also use them with <xref:System.Collections.Generic.Dictionary%602> collections and similar types:
Now, you can use them with <xref:System.Collections.Generic.Dictionary%602> collections and similar types more consistent regular index usage and assignment:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rephrase the sentence, it doesn't look grammatically correct now.

Copy link
Member

Choose a reason for hiding this comment

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

I'd rephrase as "and similar types. The new syntax supports assignment using an index into the collection."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated and submitted with the changes. Sorry for the previous issues and look forward to learning more and assisting in a greater capacity with the documentation in the future! Thanks for the help. Let me know if there are any remaining changes to be made.

@JRAlexander JRAlexander added the ✨ 1st-time docs contributor! Indicates PRs from new contributors to the docs repository label May 21, 2018
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.

Thanks for submitting this change @DevonAleshire We appreciate it.

I've looked at the changes, and I have a suggestion to one of the comments by @pkulikov.

If you can make an update to the same branch to update PR, I'll merge it.

Thanks again for your contribution.

@DevonAleshire DevonAleshire mentioned this pull request May 24, 2018
@BillWagner
Copy link
Member

These changes were incorporated by @DevonAleshire into PR #5577 Closing

@BillWagner BillWagner closed this May 24, 2018
BillWagner pushed a commit that referenced this pull request May 24, 2018
* Update csharp-6 

Modified Index Initializer verbiage to identify collection initializers were able to be used with Dictionaries previously. Tried to identify that the change makes use of the indexer versus calling the add method by remaining more consistent with index usage. Might want to update example or links to the Dictionary collection initializer page within docs.

* Index Initializer #5506 

Update typo and verbiage in accordance with reviewed comments.
@mairaw mairaw removed this from the Sprint 136 (5/21/18 - 6/8/18) milestone May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ 1st-time docs contributor! Indicates PRs from new contributors to the docs repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants