From a08e5cc245b7bedabb540f9c8f5f7490502cac63 Mon Sep 17 00:00:00 2001 From: ilserd <136339905+ilserd@users.noreply.github.com> Date: Mon, 26 Jun 2023 19:15:19 +0200 Subject: [PATCH] s/Visual C#/C# in System.Linq > Enumerable (#9104) --- xml/System.Linq/Enumerable.xml | 156 ++++++++++++++++----------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/xml/System.Linq/Enumerable.xml b/xml/System.Linq/Enumerable.xml index 02e33f7397c..fbde7cabf1d 100644 --- a/xml/System.Linq/Enumerable.xml +++ b/xml/System.Linq/Enumerable.xml @@ -1966,7 +1966,7 @@ method enables the standard query operators to be invoked on non-generic collections by supplying the necessary type information. For example, does not implement , but by calling on the object, the standard query operators can then be used to query the sequence. @@ -2118,7 +2118,7 @@ Each chunk except the last one will be of size `size`. The last chunk will conta method differs from the method because the method returns all the original elements in the input sequences. The method returns only unique elements. @@ -2508,7 +2508,7 @@ Each chunk except the last one will be of size `size`. The last chunk will conta ) method. @@ -2670,7 +2670,7 @@ Each chunk except the last one will be of size `size`. The last chunk will conta method returns an unordered sequence that contains no duplicate values. It uses the default equality comparer, , to compare values. @@ -2755,7 +2755,7 @@ Each chunk except the last one will be of size `size`. The last chunk will conta method returns an unordered sequence that contains no duplicate values. If `comparer` is `null`, the default equality comparer, , is used to compare values. @@ -2819,7 +2819,7 @@ Each chunk except the last one will be of size `size`. The last chunk will conta ## Remarks -This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its `GetEnumerator` method directly or by using `foreach` in Visual C# or `For Each` in Visual Basic. +This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its `GetEnumerator` method directly or by using `foreach` in C# or `For Each` in Visual Basic. The method returns an unordered sequence that contains no duplicate values. The default equality comparer, , is used to compare values. @@ -2875,7 +2875,7 @@ The method returns an unordered sequence that contains no duplicate values. If `comparer` is `null`, the default equality comparer, , is used to compare values. @@ -3267,7 +3267,7 @@ Only unique elements are returned. , is used to compare values of the types. To compare a custom data type, you need to override the and the methods, and optionally implement the generic interface in the custom type. For more information, see the property. @@ -3902,7 +3902,7 @@ Only unique elements are returned. [!NOTE] > For examples of `GroupBy`, see the following articles: @@ -3917,7 +3917,7 @@ Only unique elements are returned. The default equality comparer is used to compare keys. - In query expression syntax, a `group by` (Visual C#) or `Group By Into` (Visual Basic) clause translates to an invocation of . For more information and usage examples, see [group clause](/dotnet/csharp/language-reference/keywords/group-clause) and [Group By Clause](/dotnet/visual-basic/language-reference/queries/group-by-clause). + In query expression syntax, a `group by` (C#) or `Group By Into` (Visual Basic) clause translates to an invocation of . For more information and usage examples, see [group clause](/dotnet/csharp/language-reference/keywords/group-clause) and [Group By Clause](/dotnet/visual-basic/language-reference/queries/group-by-clause). ]]> @@ -3983,7 +3983,7 @@ Only unique elements are returned. [!NOTE] > For examples of `GroupBy`, see the following articles: @@ -4000,7 +4000,7 @@ Only unique elements are returned. If two keys are considered equal according to `comparer`, the first key is chosen as the key for that grouping. - In query expression syntax, a `group by` (Visual C#) or `Group By Into` (Visual Basic) clause translates to an invocation of . For more information and usage examples, see [group clause](/dotnet/csharp/language-reference/keywords/group-clause) and [Group By Clause](/dotnet/visual-basic/language-reference/queries/group-by-clause). + In query expression syntax, a `group by` (C#) or `Group By Into` (Visual Basic) clause translates to an invocation of . For more information and usage examples, see [group clause](/dotnet/csharp/language-reference/keywords/group-clause) and [Group By Clause](/dotnet/visual-basic/language-reference/queries/group-by-clause). ]]> @@ -4067,7 +4067,7 @@ Only unique elements are returned. method returns a collection of objects, one for each distinct key that was encountered. An is an that also has a key associated with its elements. @@ -4081,13 +4081,13 @@ Only unique elements are returned. :::code language="csharp" source="~/snippets/csharp/System.Linq/Enumerable/AggregateTSource/enumerable.cs" id="Snippet39"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Enumerable/VB/Enumerable.vb" id="Snippet39"::: - In query expression syntax, a `group by` (Visual C#) or `Group By Into` (Visual Basic) clause translates to an invocation of . The translation of the query expression in the following example is equivalent to the query in the example above. + In query expression syntax, a `group by` (C#) or `Group By Into` (Visual Basic) clause translates to an invocation of . The translation of the query expression in the following example is equivalent to the query in the example above. :::code language="csharp" source="~/snippets/csharp/System.Linq/Enumerable/AggregateTSource/enumerable.cs" id="Snippet122"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Linq.Enumerable/VB/Enumerable.vb" id="Snippet122"::: > [!NOTE] -> In a Visual C# or Visual Basic query expression, the element and key selection expressions occur in the reverse order from their argument positions in a call to the method. +> In a C# or Visual Basic query expression, the element and key selection expressions occur in the reverse order from their argument positions in a call to the method. ]]> @@ -4157,7 +4157,7 @@ Only unique elements are returned. [!NOTE] > For examples of `GroupBy`, see the following articles: @@ -4174,7 +4174,7 @@ Only unique elements are returned. If two keys are considered equal according to `comparer`, the first key is chosen as the key for that grouping. - In query expression syntax, a `group by` (Visual C#) or `Group By Into` (Visual Basic) clause translates to an invocation of . For more information and usage examples, see [group clause](/dotnet/csharp/language-reference/keywords/group-clause) and [Group By Clause](/dotnet/visual-basic/language-reference/queries/group-by-clause). + In query expression syntax, a `group by` (C#) or `Group By Into` (Visual Basic) clause translates to an invocation of . For more information and usage examples, see [group clause](/dotnet/csharp/language-reference/keywords/group-clause) and [Group By Clause](/dotnet/visual-basic/language-reference/queries/group-by-clause). ]]> @@ -4241,7 +4241,7 @@ Only unique elements are returned. . + In query expression syntax, a `group by` (C#) or `Group By Into` (Visual Basic) clause translates to an invocation of . ## Examples The following code example demonstrates how to use to group the elements of a sequence and project a sequence of results of type `TResult`. @@ -4381,7 +4381,7 @@ Only unique elements are returned. . + In query expression syntax, a `group by` (C#) or `Group By Into` (Visual Basic) clause translates to an invocation of . ## Examples The following code example demonstrates how to use to group the projected elements of a sequence and then project a sequence of results of type `TResult`. @@ -4538,7 +4538,7 @@ Only unique elements are returned. , is used to hash and compare keys. @@ -4553,7 +4553,7 @@ Only unique elements are returned. has no direct equivalent in traditional relational database terms. However, this method does implement a superset of inner joins and left outer joins. Both of these operations can be written in terms of a grouped join. For more information, see [Join operations](/dotnet/csharp/programming-guide/concepts/linq/join-operations). - In query expression syntax, a `join ... into` (Visual C#) or `Group Join` (Visual Basic) clause translates to an invocation of . + In query expression syntax, a `join ... into` (C#) or `Group Join` (Visual Basic) clause translates to an invocation of . ## Examples The following code example demonstrates how to use to perform a grouped join on two sequences. @@ -4637,7 +4637,7 @@ Only unique elements are returned. , is used to hash and compare keys. @@ -4724,7 +4724,7 @@ Only unique elements are returned. , is used to hash and compare keys. @@ -5042,7 +5042,7 @@ If `comparer` is `null`, the default equality comparer, preserves the order of the elements of `outer`, and for each of these elements, the order of the matching elements of `inner`. - In query expression syntax, a `join` (Visual C#) or `Join` (Visual Basic) clause translates to an invocation of . + In query expression syntax, a `join` (C#) or `Join` (Visual Basic) clause translates to an invocation of . In relational database terms, the method implements an inner equijoin. 'Inner' means that only elements that have a match in the other sequence are included in the results. An 'equijoin' is a join in which the keys are compared for equality. A left outer join operation has no dedicated standard query operator, but can be performed by using the method. For more information, see [Join operations](/dotnet/csharp/programming-guide/concepts/linq/join-operations). @@ -5128,7 +5128,7 @@ If `comparer` is `null`, the default equality comparer, , is used to hash and compare keys. @@ -8991,7 +8991,7 @@ If `TKey` is a reference type and the source sequence is empty or contains only method returns only those elements in `source` that can be cast to type `TResult`. To instead receive an exception if an element cannot be cast to type `TResult`, use . @@ -9179,9 +9179,9 @@ If comparer is `null`, the default comparer x` in Visual C# or `Function(x) x` in Visual Basic) for `keySelector`. + To order a sequence by the values of the elements themselves, specify the identity function (`x => x` in C# or `Function(x) x` in Visual Basic) for `keySelector`. Two methods are defined to extend the type , which is the return type of this method. These two methods, namely `ThenBy` and `ThenByDescending`, enable you to specify additional sort criteria to sort a sequence. `ThenBy` and `ThenByDescending` also return an , which means any number of consecutive calls to `ThenBy` or `ThenByDescending` can be made. @@ -9192,7 +9192,7 @@ If comparer is `null`, the default comparer x` in Visual C# or `Function(x) x` in Visual Basic) for `keySelector`. + To order a sequence by the values of the elements themselves, specify the identity function (`x => x` in C# or `Function(x) x` in Visual Basic) for `keySelector`. Two methods are defined to extend the type , which is the return type of this method. These two methods, namely `ThenBy` and `ThenByDescending`, enable you to specify additional sort criteria to sort a sequence. `ThenBy` and `ThenByDescending` also return an , which means any number of consecutive calls to `ThenBy` or `ThenByDescending` can be made. @@ -9351,9 +9351,9 @@ If comparer is `null`, the default comparer x` in Visual C# or `Function(x) x` in Visual Basic) for `keySelector`. + To order a sequence by the values of the elements themselves, specify the identity function (`x => x` in C# or `Function(x) x` in Visual Basic) for `keySelector`. For an example of this method, see . @@ -9366,7 +9366,7 @@ If comparer is `null`, the default comparer x` in Visual C# or `Function(x) x` in Visual Basic) for `keySelector`. + To order a sequence by the values of the elements themselves, specify the identity function (`x => x` in C# or `Function(x) x` in Visual Basic) for `keySelector`. Two methods are defined to extend the type , which is the return type of this method. These two methods, namely `ThenBy` and `ThenByDescending`, enable you to specify additional sort criteria to sort a sequence. `ThenBy` and `ThenByDescending` also return an , which means any number of consecutive calls to `ThenBy` or `ThenByDescending` can be made. @@ -9683,7 +9683,7 @@ If comparer is `null`, the default comparer to generate a sequence of values. @@ -9752,7 +9752,7 @@ If comparer is `null`, the default comparer to generate a sequence of a repeated value. @@ -9815,7 +9815,7 @@ If comparer is `null`, the default comparer , this sorting method does not consider the actual values themselves in determining the order. Rather, it just returns the elements in the reverse order from which they are produced by the underlying source. @@ -9896,7 +9896,7 @@ If comparer is `null`, the default comparer method instead of . Although `SelectMany` works similarly to `Select`, it differs in that the transform function returns a collection that is then expanded by `SelectMany` before it is returned. - In query expression syntax, a `select` (Visual C#) or `Select` (Visual Basic) clause translates to an invocation of . + In query expression syntax, a `select` (C#) or `Select` (Visual Basic) clause translates to an invocation of . ## Examples The following code example demonstrates how to use to project over a sequence of values. @@ -10051,11 +10051,11 @@ If comparer is `null`, the default comparer method enumerates the input sequence, uses a transform function to map each element to an , and then enumerates and yields the elements of each such object. That is, for each element of `source`, `selector` is invoked and a sequence of values is returned. then flattens this two-dimensional collection of collections into a one-dimensional and returns it. For example, if a query uses to obtain the orders (of type `Order`) for each customer in a database, the result is of type `IEnumerable` in C# or `IEnumerable(Of Order)` in Visual Basic. If instead the query uses to obtain the orders, the collection of collections of orders is not combined and the result is of type `IEnumerable>` in C# or `IEnumerable(Of List(Of Order))` in Visual Basic. - In query expression syntax, each `from` clause (Visual C#) or `From` clause (Visual Basic) after the initial one translates to an invocation of . + In query expression syntax, each `from` clause (C#) or `From` clause (Visual Basic) after the initial one translates to an invocation of . ## Examples The following code example demonstrates how to use to perform a one-to-many projection over an array. @@ -10124,7 +10124,7 @@ If comparer is `null`, the default comparer method enumerates the input sequence, uses a transform function to map each element to an , and then enumerates and yields the elements of each such object. That is, for each element of `source`, `selector` is invoked and a sequence of values is returned. then flattens this two-dimensional collection of collections into a one-dimensional and returns it. For example, if a query uses to obtain the orders (of type `Order`) for each customer in a database, the result is of type `IEnumerable` in C# or `IEnumerable(Of Order)` in Visual Basic. If instead the query uses to obtain the orders, the collection of collections of orders is not combined and the result is of type `IEnumerable>` in C# or `IEnumerable(Of List(Of Order))` in Visual Basic. @@ -10199,11 +10199,11 @@ If comparer is `null`, the default comparer method is useful when you have to keep the elements of `source` in scope for query logic that occurs after the call to . See the Example section for a code example. If there is a bidirectional relationship between objects of type `TSource` and objects of type `TCollection`, that is, if an object of type `TCollection` provides a property to retrieve the `TSource` object that produced it, you do not need this overload of . Instead, you can use and navigate back to the `TSource` object through the `TCollection` object. - In query expression syntax, each `from` clause (Visual C#) or `From` clause (Visual Basic) after the initial one translates to an invocation of . + In query expression syntax, each `from` clause (C#) or `From` clause (Visual Basic) after the initial one translates to an invocation of . ## Examples The following code example demonstrates how to use to perform a one-to-many projection over an array and use a result selector function to keep each corresponding element from the source sequence in scope for the final call to `Select`. @@ -10276,7 +10276,7 @@ If comparer is `null`, the default comparer method is useful when you have to keep the elements of `source` in scope for query logic that occurs after the call to . See the Example section for a code example. If there is a bidirectional relationship between objects of type `TSource` and objects of type `TCollection`, that is, if an object of type `TCollection` provides a property to retrieve the `TSource` object that produced it, you do not need this overload of . Instead, you can use and navigate back to the `TSource` object through the `TCollection` object. @@ -10922,7 +10922,7 @@ If comparer is `null`, the default comparer is returned. If `count` is less than or equal to zero, all elements of `source` are yielded. @@ -11059,7 +11059,7 @@ If `count` is not a positive number, this method returns an identical copy of th method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its `GetEnumerator` method directly or by using `foreach` in Visual C# or `For Each` in Visual Basic. + The method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its `GetEnumerator` method directly or by using `foreach` in C# or `For Each` in Visual Basic. This method tests each element of `source` by using `predicate` and skips the element if the result is `true`. After the predicate function returns `false` for an element, that element and the remaining elements in `source` are yielded and there are no more invocations of `predicate`. @@ -11133,7 +11133,7 @@ If `count` is not a positive number, this method returns an identical copy of th method tests each element of `source` by using `predicate` and skips the element if the result is `true`. After the predicate function returns `false` for an element, that element and the remaining elements in `source` are yielded and there are no more invocations of `predicate`. @@ -12542,7 +12542,7 @@ In Visual Basic query expression syntax, an `Aggregate Into Sum()` clause transl enumerates `source` and yields elements until `count` elements have been yielded or `source` contains no more elements. If `count` exceeds the number of elements in `source`, all elements of `source` are returned. @@ -12606,7 +12606,7 @@ In Visual Basic query expression syntax, an `Aggregate Into Sum()` clause transl ## Remarks -This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its `GetEnumerator` method directly or by using `foreach` in Visual C# or `For Each` in Visual Basic. +This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its `GetEnumerator` method directly or by using `foreach` in C# or `For Each` in Visual Basic. enumerates `source` and yields elements whose indices belong to the specified `range`. @@ -12732,7 +12732,7 @@ If `count` is not a positive number, this method returns an empty enumerable col method tests each element of `source` by using `predicate` and yields the element if the result is `true`. Enumeration stops when the predicate function returns `false` for an element or when `source` contains no more elements. @@ -12804,7 +12804,7 @@ If `count` is not a positive number, this method returns an empty enumerable col method tests each element of `source` by using `predicate` and yields the element if the result is `true`. Enumeration stops when the predicate function returns `false` for an element or when `source` contains no more elements. @@ -12891,9 +12891,9 @@ If `count` is not a positive number, this method returns an empty enumerable col x` in Visual C# or `Function(x) x` in Visual Basic) for `keySelector`. + To order a sequence by the values of the elements themselves, specify the identity function (`x => x` in C# or `Function(x) x` in Visual Basic) for `keySelector`. and are defined to extend the type , which is also the return type of these methods. This design enables you to specify multiple sort criteria by applying any number of or methods. @@ -12904,7 +12904,7 @@ If `count` is not a positive number, this method returns an empty enumerable col This method performs a stable sort; that is, if the keys of two elements are equal, the order of the elements is preserved. In contrast, an unstable sort does not preserve the order of elements that have the same key. - In query expression syntax, an `orderby [first criterion], [second criterion]` (Visual C#) or `Order By [first criterion], [second criterion]` (Visual Basic) clause translates to an invocation of . + In query expression syntax, an `orderby [first criterion], [second criterion]` (C#) or `Order By [first criterion], [second criterion]` (Visual Basic) clause translates to an invocation of . ## Examples The following code example demonstrates how to use to perform a secondary ordering of the elements in a sequence. @@ -12976,9 +12976,9 @@ If `count` is not a positive number, this method returns an empty enumerable col x` in Visual C# or `Function(x) x` in Visual Basic) for `keySelector`. + To order a sequence by the values of the elements themselves, specify the identity function (`x => x` in C# or `Function(x) x` in Visual Basic) for `keySelector`. and are defined to extend the type , which is also the return type of these methods. This design enables you to specify multiple sort criteria by applying any number of or methods. @@ -13059,9 +13059,9 @@ If `count` is not a positive number, this method returns an empty enumerable col x` in Visual C# or `Function(x) x` in Visual Basic) for `keySelector`. + To order a sequence by the values of the elements themselves, specify the identity function (`x => x` in C# or `Function(x) x` in Visual Basic) for `keySelector`. and are defined to extend the type , which is also the return type of these methods. This design enables you to specify multiple sort criteria by applying any number of or methods. @@ -13072,7 +13072,7 @@ If `count` is not a positive number, this method returns an empty enumerable col This method performs a stable sort; that is, if the keys of two elements are equal, the order of the elements is preserved. In contrast, an unstable sort does not preserve the order of elements that have the same key. - In Visual C# query expression syntax, an `orderby [first criterion], [second criterion] descending` clause translates to an invocation of . + In C# query expression syntax, an `orderby [first criterion], [second criterion] descending` clause translates to an invocation of . In Visual Basic query expression syntax, an `Order By [first criterion], [second criterion] Descending` clause translates to an invocation of . @@ -13140,9 +13140,9 @@ If `count` is not a positive number, this method returns an empty enumerable col x` in Visual C# or `Function(x) x` in Visual Basic) for `keySelector`. + To order a sequence by the values of the elements themselves, specify the identity function (`x => x` in C# or `Function(x) x` in Visual Basic) for `keySelector`. and are defined to extend the type , which is also the return type of these methods. This design enables you to specify multiple sort criteria by applying any number of or methods. @@ -14257,7 +14257,7 @@ The method is typically a constant-time operation, but ultimately this depends o method, which returns all the elements in the input sequences including duplicates. @@ -14344,7 +14344,7 @@ The method is typically a constant-time operation, but ultimately this depends o , is used to compare values. @@ -14415,7 +14415,7 @@ The method is typically a constant-time operation, but ultimately this depends o ## Remarks -This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its `GetEnumerator` method directly or by using `foreach` in Visual C# or `For Each` in Visual Basic. +This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its `GetEnumerator` method directly or by using `foreach` in C# or `For Each` in Visual Basic. The default equality comparer, , is used to compare values. @@ -14475,7 +14475,7 @@ When the object returned by this method is enumerated, , is used to compare values. @@ -14550,9 +14550,9 @@ When the object returned by this method is enumerated, . + In query expression syntax, a `where` (C#) or `Where` (Visual Basic) clause translates to an invocation of . ## Examples The following code example demonstrates how to use to filter a sequence. @@ -14619,7 +14619,7 @@ When the object returned by this method is enumerated,