HttpContentCollectionExtensions.FirstDispositionTypeOrDefault Method

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

Returns the first HttpContent in a sequence that has a ContentDispositionHeaderValue header field with a DispositionType property equal to dispositionType.

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

Syntax

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

Parameters

  • dispositionType
    Type: System.String
    The disposition type to look for.

Return Value

Type: System.Net.Http.HttpContent
null if source is empty or if no element matches; otherwise the first HttpContent in the sequence with a matching disposition 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

System.Net.Http Namespace