dotnet / dotnet/dotnet-api-docs

Please add example

Open
#2,506 1 comment 0 reactions 0 assignees View on GitHub
area-System.Collections dotnet-api/prod example-request Pri2
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

@x13xxxswatxxx commented on [Sat May 18 2019](https://github.com/dotnet/dotnet-api-docs.ru-ru/issues/23)

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)](https://docs.microsoft.com/ru-ru/dotnet/api/system.collections.generic.comparer-1.create?view=netframework-4.8#feedback)
* Content Source: [xml/System.Collections.Generic/Comparer`1.xml](https://github.com/dotnet/dotnet-api-docs.ru-ru/blob/live/xml/System.Collections.Generic/Comparer`1.xml)
* Product: **dotnet-api**
* Technology: **system.collections**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

---

@CeciAc commented on [Tue May 21 2019](https://github.com/dotnet/dotnet-api-docs.ru-ru/issues/23#issuecomment-494509498)

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://github.com/dotnet/dotnet-api-docs.ru-ru/issues/23#issuecomment-494649706)

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 _HTTPError = new Dictionary()
{
[400] = "Bad Request",
[401] = "Unauthorized"
}

_HTTPError.Append(new KeyValuePair(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 _HTTPError = new Dictionary()
{
[400] = "Bad Request",
[401] = "Unauthorized"
}

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

---

@MSDN-WhiteKnight commented on [Wed May 22 2019](https://github.com/dotnet/dotnet-api-docs.ru-ru/issues/23#issuecomment-494695602)

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](https://github.com/dotnet/dotnet-api-docs.ru-ru/issues/23#issuecomment-494773640)

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.