dotnet / dotnet/dotnet-api-docs

Some Max exception documentation is incorrect

Aperta
#3,978 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area-System.Linq Pri3 untriaged
Lingua principale
C#
Stelle
949
Fork
1.7k
Merge medio
2g 19h
PR unite (30g)
52

Descrizione

- 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla documentazione API collegata di System.Linq.Enumerable.Max ed esamina ogni overload indicato nell’issue. Confronta il comportamento documentato relativo alle eccezioni e alle origini vuote con i casi elencati, quindi aggiorna il testo di riferimento interessato in modo che tutti i risultati segnalati siano documentati correttamente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.