DefaultContentNegotiator.MatchType Method

Selects the first supported media type of a formatter.

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

Syntax

'Declaration
Protected Overridable Function MatchType ( _
    type As Type, _
    formatter As MediaTypeFormatter _
) As MediaTypeFormatterMatch
'Usage
Dim type As Type 
Dim formatter As MediaTypeFormatter 
Dim returnValue As MediaTypeFormatterMatch 

returnValue = Me.MatchType(type, formatter)
protected virtual MediaTypeFormatterMatch MatchType(
    Type type,
    MediaTypeFormatter formatter
)
protected:
virtual MediaTypeFormatterMatch^ MatchType(
    Type^ type, 
    MediaTypeFormatter^ formatter
)
abstract MatchType : 
        type:Type * 
        formatter:MediaTypeFormatter -> MediaTypeFormatterMatch  
override MatchType : 
        type:Type * 
        formatter:MediaTypeFormatter -> MediaTypeFormatterMatch
protected function MatchType(
    type : Type, 
    formatter : MediaTypeFormatter
) : MediaTypeFormatterMatch

Parameters

Return Value

Type: System.Net.Http.Formatting.MediaTypeFormatterMatch
Returns a MediaTypeFormatterMatch with Ranking set to MatchOnCanWriteType, or null if there is no match.

Remarks

If ExcludeMatchOnTypeOnly is true, this method always returns null.

See Also

Reference

DefaultContentNegotiator Class

System.Net.Http.Formatting Namespace