Skip to content

Please add example #2506

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

Open
CeciAc opened this issue May 27, 2019 · 1 comment
Open

Please add example #2506

CeciAc opened this issue May 27, 2019 · 1 comment
Labels
area-System.Collections dotnet-api/prod example-request Indicates issues requesting samples Pri2 Indicates issues/PRs that are medium priority
Milestone

Comments

@CeciAc
Copy link

CeciAc commented May 27, 2019

@x13xxxswatxxx commented on Sat May 18 2019

public static System.Collections.Generic.Comparer<T> Create (Comparison<T> comparison);


Сведения о документе

Не вносите правки в этот раздел. Это необходимо для связывания страницы сайта docs.microsoft.com с вопросом на GitHub.

  • ID: 7407922f-6c5b-f488-87ab-3568bc8b872c
  • Version Independent ID: 9b175d8d-9060-a305-1a21-bce8eaa891be
  • Content: Comparer<T>.Create(Comparison<T>) Method (System.Collections.Generic)
  • Content Source: [xml/System.Collections.Generic/Comparer1.xml](https://github.com/dotnet/dotnet-api-docs.ru-ru/blob/live/xml/System.Collections.Generic/Comparer1.xml)
  • Product: dotnet-api
  • Technology: system.collections
  • GitHub Login: @dotnet-bot
  • Microsoft Alias: dotnetcontent

@CeciAc commented on Tue May 21 2019

Hello, @x13xxxswatxxx
 
We truly appreciate your comment and we strive to improve your experience in docs.microsoft.com. However, we need more information in order to be able to address your feedback. Can you please provide more detailed information and clarify your comment?
 
Kind regards,
Microsoft DOCS International Team


@x13xxxswatxxx commented on Wed May 22 2019

https://docs.microsoft.com/ru-ru/dotnet/api/system.collections.generic.dictionary-2.keycollection?view=netframework-4.8
Extension Methods in rus version
Append(IEnumerable, TSource) - Добавляет значение в конец последовательности. (Adds a value to the end of the sequence.)
My example: don't Adds a value to the end of the sequence
Dictionary<int, string> _HTTPError = new Dictionary<int, string>()
{
[400] = "Bad Request",
[401] = "Unauthorized"
}

_HTTPError.Append(new KeyValuePair<int, string>(2000, "Fail line!"));
Console.WriteLine(_HTTPError[2000]);
System.Collections.Generic.KeyNotFoundException: "The given key '2000' was not present in the dictionary."
 
Append method returns a new sequence
Dictionary<int, string> _HTTPError = new Dictionary<int, string>()
{
[400] = "Bad Request",
[401] = "Unauthorized"
}

var _new = _HTTPError.Append(new KeyValuePair<int, string>(2000, "Fail line!"));
Console.WriteLine(_new[2000]);
It work


@MSDN-WhiteKnight commented on Wed May 22 2019

Append method is not a part of Dictionary class, it's an extension method of IEnumerable. This aspect is covered in detail in its article: https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.append?view=netframework-4.8#remarks

Note

This method does not modify the elements of the collection. Instead, it creates a copy of the collection with the new element.

I don't think any changes should be made to Dictionary article. But it might be useful to reword Append method summary a little. Such as Returns a new sequence, produced by appending a value to the end of the source sequence.


@x13xxxswatxxx commented on Wed May 22 2019

I'm talking about this. On this page, in the English version, there is no this method, but there is a Russian one. What is misleading. You can also get confused in any of the links Microsoft Docs. They intersect with each other, from easy to complex, in different languages. One word trash.

@dotnet-bot dotnet-bot added untriaged New issue has not been triaged by the area owner Source - Docs.ms labels May 27, 2019
@CeciAc
Copy link
Author

CeciAc commented May 27, 2019

Hi team,
I'm moving this here since It looks like the cntributor is requesting aditional information on the article.

@rpetrusha rpetrusha added this to the Backlog milestone Jun 3, 2019
@rpetrusha rpetrusha added example-request Indicates issues requesting samples and removed untriaged New issue has not been triaged by the area owner labels Jun 3, 2019
@PRMerger9 PRMerger9 added the Pri2 Indicates issues/PRs that are medium priority label Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Collections dotnet-api/prod example-request Indicates issues requesting samples Pri2 Indicates issues/PRs that are medium priority
Projects
None yet
Development

No branches or pull requests

7 participants