Skip to content

Commit 8d6482e

Browse files
authored
Update remarks and exceptions for MaxBy/MinBy (#9321)
1 parent 992ebd0 commit 8d6482e

File tree

1 file changed

+16
-36
lines changed

1 file changed

+16
-36
lines changed

xml/System.Linq/Enumerable.xml

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8257,18 +8257,13 @@ In Visual Basic query expression syntax, an `Aggregate Into Max()` clause transl
82578257
<param name="keySelector">A function to extract the key for each element.</param>
82588258
<summary>Returns the maximum value in a generic sequence according to a specified key selector function.</summary>
82598259
<returns>The value with the maximum key in the sequence.</returns>
8260-
<remarks>
8261-
<format type="text/markdown"><![CDATA[
8262-
8263-
## Remarks
8264-
8265-
If `TKey` is a reference type and the source sequence is empty or contains only values that are `null`, this method returns `null`.
8266-
8267-
]]></format>
8268-
</remarks>
8260+
<remarks><para>If the source sequence is empty and <typeparamref name="TSource" /> is a nullable type, this method returns <see langword="null" />. If the source sequence is empty and <typeparamref name="TSource" /> is a non-nullable struct, such as a primitive type, an <see cref="T:System.InvalidOperationException" /> is thrown.</para>
8261+
<para>If the source sequence contains only values that are <see langword="null" />.</para></remarks>
82698262
<exception cref="T:System.ArgumentNullException">
82708263
<paramref name="source" /> is <see langword="null" />.</exception>
82718264
<exception cref="T:System.ArgumentException">No key extracted from <paramref name="source" /> implements the <see cref="T:System.IComparable" /> or <see cref="T:System.IComparable`1" /> interface.</exception>
8265+
<exception cref="T:System.InvalidOperationException">
8266+
<typeparamref name="TSource" /> is a primitive type and the source sequence is empty.</exception>
82728267
</Docs>
82738268
</Member>
82748269
<Member MemberName="MaxBy&lt;TSource,TKey&gt;">
@@ -8338,18 +8333,13 @@ If `TKey` is a reference type and the source sequence is empty or contains only
83388333
<param name="comparer">The <see cref="T:System.Collections.Generic.IComparer`1" /> to compare keys.</param>
83398334
<summary>Returns the maximum value in a generic sequence according to a specified key selector function and key comparer.</summary>
83408335
<returns>The value with the maximum key in the sequence.</returns>
8341-
<remarks>
8342-
<format type="text/markdown"><![CDATA[
8343-
8344-
## Remarks
8345-
8346-
If `TKey` is a reference type and the source sequence is empty or contains only values that are `null`, this method returns `null`.
8347-
8348-
]]></format>
8349-
</remarks>
8336+
<remarks><para>If the source sequence is empty and <typeparamref name="TSource" /> is a nullable type, this method returns <see langword="null" />. If the source sequence is empty and <typeparamref name="TSource" /> is a non-nullable struct, such as a primitive type, an <see cref="T:System.InvalidOperationException" /> is thrown.</para>
8337+
<para>If the source sequence contains only values that are <see langword="null" />.</para></remarks>
83508338
<exception cref="T:System.ArgumentNullException">
83518339
<paramref name="source" /> is <see langword="null" />.</exception>
83528340
<exception cref="T:System.ArgumentException">No key extracted from <paramref name="source" /> implements the <see cref="T:System.IComparable" /> or <see cref="T:System.IComparable`1" /> interface.</exception>
8341+
<exception cref="T:System.InvalidOperationException">
8342+
<typeparamref name="TSource" /> is a primitive type and the source sequence is empty.</exception>
83538343
</Docs>
83548344
</Member>
83558345
<MemberGroup MemberName="Min">
@@ -10061,18 +10051,13 @@ In Visual Basic query expression syntax, an `Aggregate Into Min()` clause transl
1006110051
<param name="keySelector">A function to extract the key for each element.</param>
1006210052
<summary>Returns the minimum value in a generic sequence according to a specified key selector function.</summary>
1006310053
<returns>The value with the minimum key in the sequence.</returns>
10064-
<remarks>
10065-
<format type="text/markdown"><![CDATA[
10066-
10067-
## Remarks
10068-
10069-
If `TKey` is a reference type and the source sequence is empty or contains only values that are `null`, this method returns `null`.
10070-
10071-
]]></format>
10072-
</remarks>
10054+
<remarks><para>If the source sequence is empty and <typeparamref name="TSource" /> is a nullable type, this method returns <see langword="null" />. If the source sequence is empty and <typeparamref name="TSource" /> is a non-nullable struct, such as a primitive type, an <see cref="T:System.InvalidOperationException" /> is thrown.</para>
10055+
<para>If the source sequence contains only values that are <see langword="null" />.</para></remarks>
1007310056
<exception cref="T:System.ArgumentNullException">
1007410057
<paramref name="source" /> is <see langword="null" />.</exception>
1007510058
<exception cref="T:System.ArgumentException">No key extracted from <paramref name="source" /> implements the <see cref="T:System.IComparable" /> or <see cref="T:System.IComparable`1" /> interface.</exception>
10059+
<exception cref="T:System.InvalidOperationException">
10060+
<typeparamref name="TSource" /> is a primitive type and the source sequence is empty.</exception>
1007610061
</Docs>
1007710062
</Member>
1007810063
<Member MemberName="MinBy&lt;TSource,TKey&gt;">
@@ -10142,18 +10127,13 @@ If `TKey` is a reference type and the source sequence is empty or contains only
1014210127
<param name="comparer">The <see cref="T:System.Collections.Generic.IComparer`1" /> to compare keys.</param>
1014310128
<summary>Returns the minimum value in a generic sequence according to a specified key selector function and key comparer.</summary>
1014410129
<returns>The value with the minimum key in the sequence.</returns>
10145-
<remarks>
10146-
<format type="text/markdown"><![CDATA[
10147-
10148-
## Remarks
10149-
10150-
If `TKey` is a reference type and the source sequence is empty or contains only values that are `null`, this method returns `null`.
10151-
10152-
]]></format>
10153-
</remarks>
10130+
<remarks><para>If the source sequence is empty and <typeparamref name="TSource" /> is a nullable type, this method returns <see langword="null" />. If the source sequence is empty and <typeparamref name="TSource" /> is a non-nullable struct, such as a primitive type, an <see cref="T:System.InvalidOperationException" /> is thrown.</para>
10131+
<para>If the source sequence contains only values that are <see langword="null" />.</para></remarks>
1015410132
<exception cref="T:System.ArgumentNullException">
1015510133
<paramref name="source" /> is <see langword="null" />.</exception>
1015610134
<exception cref="T:System.ArgumentException">No key extracted from <paramref name="source" /> implements the <see cref="T:System.IComparable" /> or <see cref="T:System.IComparable`1" /> interface.</exception>
10135+
<exception cref="T:System.InvalidOperationException">
10136+
<typeparamref name="TSource" /> is a primitive type and the source sequence is empty.</exception>
1015710137
</Docs>
1015810138
</Member>
1015910139
<Member MemberName="OfType&lt;TResult&gt;">

0 commit comments

Comments
 (0)