dotnet / dotnet/dotnet-api-docs

Some Max exception documentation is incorrect

Offen
#3,978 9 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area-System.Linq Pri3 untriaged
Vorherrschende Sprache
C#
Sterne
949
Forks
1.7k
Ø Merge
2 T. 19 Std.
Gemergte PRs (30 T.)
52

Beschreibung

- The documentation [here](https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.max?view=netframework-4.8#System_Linq_Enumerable_Max__1_System_Collections_Generic_IEnumerable___0__) indicates that an ArgumentException will be thrown if no element in source implements IComparable or IComparable. This is not true if source contains only a single element, even if that element does not implement IComparable or IComparable
- The documentation [here](https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.max?view=netframework-4.8#System_Linq_Enumerable_Max__1_System_Collections_Generic_IEnumerable___0__) does not indicate that an ArgumentException will be thrown if some of the elements of source implement IComparable and some of the elements of source do not implement IComparable or IComparable
- The documentation [here](https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.max?view=netframework-4.8#System_Linq_Enumerable_Max__1_System_Collections_Generic_IEnumerable___0__) indicates that null can be returned if TSource is a reference type and source is empty, but it does not indicate that an InvalidOperationException will be thrown if TSource is a value type and source is empty
- The documentation [here](https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.max?view=netframework-4.8#System_Linq_Enumerable_Max__2_System_Collections_Generic_IEnumerable___0__System_Func___0___1__) does not indicate that an ArgumentException can be thrown if none of the projected elements implement IComparable or IComparable, or if only some of them implement IComparable or IComparable
- The documentation [here](https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.max?view=netframework-4.8#System_Linq_Enumerable_Max__2_System_Collections_Generic_IEnumerable___0__System_Func___0___1__) does not indicate that an InvalidOperationException can be thrown if TResult is a value type and source is empty
- The documentation [here](https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.max?view=netframework-4.8#System_Linq_Enumerable_Max__1_System_Collections_Generic_IEnumerable___0__System_Func___0_System_Nullable_System_Int32___) does not indicate that null will be returned if source is empty
- The documentation [here](https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.max?view=netframework-4.8#System_Linq_Enumerable_Max__1_System_Collections_Generic_IEnumerable___0__System_Func___0_System_Nullable_System_Double___) does not indicate that null will be returned if source is empty
- The documentation [here](https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.max?view=netframework-4.8#System_Linq_Enumerable_Max__2_System_Collections_Generic_IEnumerable___0__System_Func___0___1__) does not indicate that null will be returned if source is empty
- The documentation [here](https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.max?view=netframework-4.8#System_Linq_Enumerable_Max__1_System_Collections_Generic_IEnumerable___0__System_Func___0_System_Nullable_System_Int64___) does not indicate that null will be returned if source is empty

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit der verlinkten API-Dokumentation zu System.Linq.Enumerable.Max und überprüfen Sie jede im Issue genannte Überladung. Vergleichen Sie das dokumentierte Ausnahmeverhalten und das Verhalten bei einer leeren Quelle mit den aufgeführten Fällen und aktualisieren Sie anschließend den betroffenen Referenztext, sodass alle gemeldeten Ergebnisse korrekt dokumentiert sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.