HttpContentCollectionExtensions.FindAllContentType Method (IEnumerable<HttpContent>, MediaTypeHeaderValue)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Returns all instances of HttpContent in a sequence that has a MediaTypeHeaderValue header field with a MediaType property equal to the provided contentType.

Namespace:  System.Net.Http
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function FindAllContentType ( _
    contents As IEnumerable(Of HttpContent), _
    contentType As MediaTypeHeaderValue _
) As IEnumerable(Of HttpContent)
public static IEnumerable<HttpContent> FindAllContentType(
    this IEnumerable<HttpContent> contents,
    MediaTypeHeaderValue contentType
)
[ExtensionAttribute]
public:
static IEnumerable<HttpContent^>^ FindAllContentType(
    IEnumerable<HttpContent^>^ contents, 
    MediaTypeHeaderValue^ contentType
)
static member FindAllContentType : 
        contents:IEnumerable<HttpContent> * 
        contentType:MediaTypeHeaderValue -> IEnumerable<HttpContent> 
public static function FindAllContentType(
    contents : IEnumerable<HttpContent>, 
    contentType : MediaTypeHeaderValue
) : IEnumerable<HttpContent>

Parameters

Return Value

Type: System.Collections.Generic.IEnumerable<HttpContent>
null if source is empty or if no element matches; otherwise the first HttpContent in the sequence with a matching media type.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<HttpContent>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

.NET Framework Security

See Also

Reference

HttpContentCollectionExtensions Class

FindAllContentType Overload

System.Net.Http Namespace