dotnet / dotnet/dotnet-api-docs

Missing exception type on xml docs for SingleOrDefault(src, predicate)

Open
#3,963 2 comments 0 reactions 0 assignees View on GitHub
area-System.Linq Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

`public static TSource SingleOrDefault(this IEnumerable source);` has the doc for all exceptions.

`public static TSource SingleOrDefault(this IEnumerable source, Func predicate);`
looks like it's missing the invalid operation one.

```c#
// .....
// Exceptions:
// T:System.ArgumentNullException:
// source is null.
//
// T:System.InvalidOperationException:
// The input sequence contains more than one element.
public static TSource SingleOrDefault(this IEnumerable source);

// .....
// Exceptions:
// T:System.ArgumentNullException:
// source or predicate is null.
public static TSource SingleOrDefault(this IEnumerable source, Func predicate);
```

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.