dotnet / dotnet/dotnet-api-docs

"Extension Methods" lists generic methods whose type arguments or constraints do not match

Open
#1,540 3 comments 2 reactions 0 assignees View on GitHub
area-System.Net dotnet-api/prod Pri2 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

The `System.Net.Http.MultipartContent` class implements `IEnumerable`. The documentation of this class lists many extension methods that are applicable to some `IEnumerable` but not to `IEnumerable`. Those extension methods should not be listed here because they cannot be used on `MultipartContent`. For example:

- `CopyToDataTable (this IEnumerable source) where T : DataRow`, because `HttpContent` is not derived from `DataRow`
- `Average (this IEnumerable source)`, because `MultipartContent` does not implement `IEnumerable`
- `Ancestors (this IEnumerable source) where T : XNode`, because `HttpContent` is not derived from `XNode`

Listing those inapplicable extension methods makes it harder to find the methods that actually can be used.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 1c23630f-1e62-f2ed-3697-ed01b305d96b
* Version Independent ID: ac5fbfde-d2b1-945d-fd7b-42fb30566209
* Content: [MultipartContent Class (System.Net.Http)](https://docs.microsoft.com/en-us/dotnet/api/system.net.http.multipartcontent?view=netframework-4.7.2#extension-methods)
* Content Source: [xml/System.Net.Http/MultipartContent.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Net.Http/MultipartContent.xml)
* Product: **dotnet-api**
* GitHub Login: @karelz
* Microsoft Alias: **ncldev**

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.